Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bind a key to sigkill in bash?

I'm developing my application (on Linux) and sadly it sometimes hangs. I can use Ctrl+C to send sigint, but my program is ignoring sigint because it's too far gone. So I have to do the process-killing-dance:

Ctrl+Z
$ ps aux | grep process_name
$ kill -9 pid

Is there a way to configure bash to send the kill signal to the current process when I press - say - Ctrl+Shift+C?

like image 237
Daniel Lucraft Avatar asked Dec 04 '08 08:12

Daniel Lucraft


1 Answers

I don't think there is any key you can use to send a SIGKILL.

Will SIGQUIT do instead? If you are not catching that, the default is to core dump the process. By default this is ^\. You can see this by running:

$ stty -a

in a terminal. It should say:

quit = ^\
like image 194
camh Avatar answered Oct 05 '22 02:10

camh