I'm trying to change some key bindings in my console (Konsole). If I map intr to Ctrl-k, by running
stty intr \^k
I don't see the change reflected in
stty -a
speed 38400 baud; rows 46; columns 172; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
Why would this be?
Note the Ctrl-K IS working to send an interrupt. Ctrl-C continues to work to send an interrupt. If I try unmapping Ctrl-C by running
stty intr ^-
or
stty intr undef
It does not get undefined, and stty -a still shows exactly as it did before, with "intr = ^C;"
Update: I now suspect it has something to do with the shell I'm running (fish). In another Konsole tab where I'm using a different profile so that I'm using bash, I'm getting the expected behavior.
stty intr \^k; stty -a
. The commands themselves work. Your hypothesis about fish seems right. It probably "fixes" the terminal around the time it prints prompt.