I wish to achieve what a
C-c (send a keyboardinterrupt) would do in a terminal outside of Emacs. How do I do that in Emacs shell mode?
In Shell mode (and many other modes that run an external command interpreter), press
C-c C-c (
comint-interrupt-subjob). That's the
C-c prefix of mode-specific commmands, followed by
C-c which is chosen to be like
C-c in a plain terminal.