I'm using stty susp ^- in a user's .bashrc shell in an attempt at preventing users from using CTRL+Z to background a process.

The reason behind this, is that we have a number of users who are used to using Oracle SQLPlus on VMS, and the default editor uses CTRL+Z to save and quit the editor. CTRL+Z on Linux obviously has a completely different action, and manages to completely baffle our users as they instinctively hit CTRL+Z.

Whilst stty susp ^- seems to work with some commands (e.g. top), it doesn't work when I really need it to, i.e. in editors such as nano or vim.

Can anyone suggest how I might achieve this?

Edit: I don't need to use bash, so an alternative shell that doesn't support job control should suffice (assuming such a shell exists).


To disable suspend (Ctrl+Z) functionality in nano, you can put unset suspend into the system global nanorc, which is most likely located at /etc/nanorc. See the nanorc(5) man page for details.

  • Glad I could help. Also note that this can probably be overriden on a per-user basis; for those brave souls who want to live dangerously, you may want to leave a little note hanging around somewhere. (I haven't tried that scenario.) – a CVn Nov 22 '11 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.