Trying to learn how to use terminal here.
So I can use ctrl-z to pause other processes, but for some reason it does not work in nano. Why that would be?
To quit nano, use the Ctrl+X key combination. If the file you are working on has been modified since the last time you saved it, you will be prompted to save the file first. Type y to save the file, or n to exit nano without saving the file.
To exit nano, all you need to do is to press CTRL + X . If you have any changes that have not been saved, you'll be prompted to save the changes before you quit the editor.
It turns out ctrl-z is a global command to send the current process to the background (not just nano) and here's a way to get a background process back, simply type: fg. and nano will be back in the terminal as it was before hitting ctrl-z.
I was looking for a solution to this and the accepted answer didn't help me.
Setting set suspend
in ~/.nanorc works!
http://www.nano-editor.org/dist/v2.2/nanorc.5.html
This can be easily done by masking the SIGTSTP signal:
#include <signal.h>
signal(SIGTSTP,SIG_IGN); /* disable ctrl-Z */
That's what nano is doing, apparently.
If you want nano to allow you for suspending it with ctrl-z you can put the line:
set suspend
into your $HOME/.nanorc
.
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