Reputation: 1775
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?
Upvotes: 13
Views: 5032
Reputation: 6978
In newer versions of nano, the -z
and --suspendable
options have been removed. Suspension is now enabled by default, but only via CTRL+T, CTRL+Z. To get back the familiar CTRL+Z behaviour, the following may be added to the .nanorc
file in the home directory, to re-enable this feature for that user: bind ^Z suspend main
. This can be achieved using the following command.
>>~/.nanorc echo 'bind ^Z suspend main'
The change can also be applied for all users by editing /etc/nanorc
instead.
Upvotes: 7
Reputation: 26194
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
.
Upvotes: 5
Reputation: 4180
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
Upvotes: 8