Wednesday, November 28, 2018

CTRL-C Stopped Working on Linux Terminal

I remotely logged in a CentOS 7.5 box via PuTTY. However, somehow, CTRL-C stopped working. It turns out that CTRL-C was being trapped, which we could examine using the trap command, e.g.,


trap -- '' SIGINT
trap -- '' SIGQUIT
trap -- '' SIGTSTP
trap -- '' SIGTTIN
trap -- '' SIGTTOU

To remove CTRL-C, i.e., SIGINT from this list, we can issue a command,

trap - SIGINT

which can be placed in the shell's profile, e.g., for bash, in $HOME/.bash_profile.

No comments:

Post a Comment