stty susp
tells the terminal driver what character (actually what byte), when received unescaped from the terminal (via the wire if a real terminal, or written to the master side of a pseudo-terminal in case of a terminal emulator or sshd
...), when ISIG
is on, causes a SIGTSTP to be sent to the foreground job.
There's no key or keyboard involved here. It's the ^Z
character by default (0x1a). xterm
and other terminal emulators generally send that character when you press Z while holding the Ctrl key.
If you want to make it harder to suspend a process, you could configure your terminal emulator so that it doesn't send ^Z
upon Ctrl+Z, but upon some other key combination. With xterm
:
xterm -xrm 'XTerm.VT100.translations: #override \
Ctrl Shift <KeyPress> X: string(0x1a)\nCtrl <KeyPress> Z:'
Sends the ^Z
character upon pressing Ctrl+Shift+X, not upon Ctrl-Z. With xterm, I don't think you can specify arbitrary key combinations, you can only use modifier keys like Ctrl or Shift.
Of course, you could also define a different byte for stty susp
and have xterm
send it on a different key combination.
Note that you probably don't want to make it a byte over 0x7f as those would appear in different UTF-8 characters.