I have no problems when open+change+save a file if I write nano filename
on the terminal.
But if I open nano and open the File Browser and open a file and try to save it, there is no default file name!:
I have tried your problem and indeed found that nano unable to "remember" the filename. My suspicion is that, when you open the editor just by typing "nano" in the command line, it only reads the content of that file, and paste it to the current buffer (without also making a new buffer for opening that file).
So try to do this:
1. Open nano just by typing nano in terminal
2. Then type alt + F to enable nano to open file into separate buffer
3. Read your file of interest from nano by ctrl + R, then ctrl + T
4. Make some modification to the file, and try to save it, It should know the filename of the original file now!
As far as I know, nano
doesn't have a default file name feature when invoked with no arguments, if that is what you are asking for.
However, you can set up a shell alias like below to achieve what you're going for. Random hex string to nearly guarantee a unique file wherever it is invoked. You can probably get fancier with a shell function, adding a filename test conditional and invoking custom arguments if they were actually specified.
alias nanod='nano $(head -c16 < /dev/urandom | xxd -pu)'
Single quotes are important; double quotes will result in the subshell being evaluated then the result aliased.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With