3

I have a problem with the Nano editor. If it ever exits unexpectedly, it leaves behind .save files, which are just versions of the edits I was making. Is there a way to disable this behaviour?

2 Answers 2

2

From Nano's man

In some cases nano will try to dump the buffer into an emergency file. This will happen mainly if nano receives a SIGHUP or SIGTERM or runs out of memory. It will write the buffer into a file named nano.save if the buffer didn’t have a name already, or will add a ".save" suffix to the current filename. If an emergency file with that name already exists in the current directory, it will add ".save" plus a number (e.g. ".save.1") to the current filename in order to make it unique. In multibuffer mode, nano will write all the open buffers to their respective emergency files.

So, it is a nano emergency file where its buffer gets dumped. The flag −F (−−multibuffer) would enable multiple file buffers, if available. The flag −R (−−restricted) or restricted mode, will guide Nano to not read or write to any file not specified on the command line; read any nanorc files; allow suspending; allow a file to be appended to, prepended to, or saved under a different name if it already has one; or use backup files or spell checking. Also accessible by invoking nano with any name beginning with ’r’ (e.g. "rnano").

3
  • Is there a way to do it without all those other limitations?
    – Levi H
    Sep 21, 2018 at 9:33
  • Dear @Levi H. yes, per the response bove, use nano -R when you call it from terminal
    – user88036
    Sep 21, 2018 at 10:46
  • 1
    that won't work, I asked if I could use it without the other limitations you posted above...
    – Levi H
    Sep 24, 2018 at 11:07
1

The -R / --restricted option will disable saves (as well as some other features):

Restricted mode: don't read or write to any file not specified on the command line; read any nanorc files; allow suspending; allow a file to be appended to, prepended to, or saved under a different name if it already has one; or use backup files or spell checking. Also accessible by invoking nano with any name beginning with 'r' (e.g. "rnano")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .