Ctrl-C no longer works in terminal on Ubuntu
The specific gnome-terminal regression that prompted this post was fixed years ago — current gnome-terminal sends
ctrl-cto the foreground process when no text is selected, and copies to clipboard only when there is a selection, which is the sensible behaviour. I’m leaving the post up because the fallback tips below still help anyone who finds a terminal wherectrl-cisn’t doing what they expect.
If ctrl-c isn’t interrupting the foreground program in your terminal, the most common cause is that the terminal has rebound ctrl-c to “copy to clipboard” unconditionally. The fix is to go into the terminal’s keyboard shortcuts and set the copy action to ctrl-shift-c instead (which has been the gnome-terminal default for a long time).
Alternative interrupts when ctrl-c is lost:
ctrl-\sendsSIGQUIT— many programs treat it as a harder interrupt and will also produce a core dump.ctrl-dsends end-of-file — useful for shells and REPLs (exits bash, node, python, etc.), but not an interrupt per se.- Each interactive program tends to have its own quit key:
qintop,less, andman;:qin vim;ctrl-x ctrl-cin emacs. - Worst case, open another terminal and
kill(orkill -9) the process by PID.
Hope that helps!