In shell mode on emacs, the current key binding for quitting the shell mode ('comint-interrupt-subjob) is "\C-c \C-c", and I want to change it to "\C-c" as in ordinary linux shell. I tried
(add-hook 'shell-mode-hook '(lambda ()
(local-set-key "\C-c" 'comint-interrupt-subjob)
))
But it did not work. Probably I need to disable the prefix assigned to "\C-c". How can I do that?
Try this:
In general, when you define keys you should define them in particular keymaps, as opposed to just hoping the
local-set-keydoes what you want.Note: I prefer using
kbdfor describing keys, your"\C-c"would work just fine.