1

I have an embedded linux/unix system with a terminal interface, and as part of that system I need to edit a file in a text editor.

The details of the file being edited need to be hidden from the end user.

Most specifically I want:

  • Instantiated like: magic-text-editor /path/to/file.txt
  • No visibility of the underlying system, so no "save as" functionality, no "open arbitrary other file", no "the file you're editing is called file.txt", no "let me drop you to a shell for no reason".
  • Options to "save-and-exit" or "abort-and-exit".

Happy to integrate a C library if an executable doesn't exist.

Anything like this exist?

3
  • It is unclear what you want. Do you want the user to edit the file contents but not know where it resides, and have no confirmations? Please explain what you are trying to do Commented Nov 16, 2024 at 11:15
  • 1
    @RohitGupta "No visibility of the underlying system" means not know where the underlying file resides. Not sure what you mean by confirmations? I need for the end user to edit a file that is hidden from the end user. Commented Nov 16, 2024 at 17:44
  • I think you are going to have to get an open source editor and change it to suit your needs. Or code an app from scratch. Commented May 19 at 7:34

1 Answer 1

-1

It looks like you want something similar to git commit without -m option, which will bring up a temporary editor for users to write commit messages. I do not know if there is an editor which restricts users a lot as you described. Maybe a possible alternative is invoking a normal editor, let users save the file to some place, then provide the path to your software.

The visibility of the underlying system could be controlled with root jail or system user with restricted permissions.

2
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. Commented Nov 18, 2024 at 18:54
  • 1
    "git commit" is a typical example, yes, but in this case the environment is an appliance and the end user must have no idea what's happening under the hood. "nano --restricted" comes close, as it prevents changing the filename or opening new files, but you still get the filename exposed, and have options that mess things up like changing line endings. Commented Nov 21, 2024 at 16:48

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.