mardi 27 octobre 2009

annoying ^C (control C) echoed in bash shell

Starting with bash 4.0*, hitting ^C (control+c) in the Konsole prints out ^C and potentially overwrites command history. For those of you, dear readers, that think that this is really annoying and lame, there is a workaround.

add

stty -echoctl

in your ~/.bashrc.
That's it.

Other control chars such as ^Z will not be displayed anymore, but i hate that much less than i hated ^C.

1 commentaire:

Unknown a dit…

In fact it's not a bash-4 change, but a readline-6 change.

To revert to the old behavior, instead of stty -echoctl, you can use this in your inputrc file :

set echo-control-characters off

It's a recent readline configuration option that appeared in readline-6.1