2

On different Linux distributions I experienced that pressing ctrl-c to stop a program (like 'cmp') or completion causes the terminal (usually xterm or gnome-terminal) to not echo the input any more. Blindly typing 'reset' fixes the terminal again. Does anyone else experiences this or even better knows how to fix it? I find it hard to reproduce and I am certain that some years ago it worked reliable.

closed as unclear what you're asking by Gilles, G-Man, Kusalananda, Archemar, Networker Jul 18 '16 at 9:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    I wouldn't expect killing cmp to have that effect. I can see it happening if you're running something that disables echo itself and doesn't handle SIGINT properly. – Keith Thompson Jul 15 '16 at 0:03
  • There've been several complaints about python command-interpreters (enough to make a nice entry in an FAQ someplace). – Thomas Dickey Jul 15 '16 at 0:10
  • @KeithThompson, exactly. That it happens with programs like 'cmp' is what really surprises me. – wonderingnewbie Jul 15 '16 at 0:15
  • The most likely explanation is that it's a consequence of your shell configuration. What shell are you using? Post its configuration files. Can you reproduce this in bash --norc or zsh -f or ksh? – Gilles Jul 15 '16 at 22:26
  • @Gilles, I use bash (I had added the bash flag to indicate that but it was removed). Using it in the default configuration for a long time is sadly not really an option for me. – wonderingnewbie Jul 17 '16 at 17:16
2

The problem occurs because some programs do not cleanup properly when they are interrupted. The usual fix would be to use reset (you'll get less satisfactory results using stty sane):

resetcontrolJ

sends a newline even when your settings are messed up.

Further reading:

Not the answer you're looking for? Browse other questions tagged or ask your own question.