Mac OS Terminal Keyboard Echo Breaks After Ctrl-C – How to Fix

macterminalterminal.app

The only two applications I've been able to reproduce the issue with are tail and cat. If I tail -f log/development.log or any file for that matter, and press CTRL-C to quit, when I type additional commands there is no keyboard echo to the screen. If I hit enter, the commands are run and they generate output, but still keyboard echo is broken.

An interesting tidbit is that I have been able to restore keyboard echo a few different ways:

1) stty echo

2) irb

running either of those commands will restore keyboard echo until one of the offending commands is exited with CTRL-C again.

I have tried setting my terminal emulation to rxvt and xterm-color, changing this does not seem to make a difference.

Best Answer

To reset your terminal use the reset command.

I don't understand why tail and cat are causing this problem since they shouldn't be doing anything to affect the terminal's line settings. Are you using Terminal.app or another terminal? Are you using Bash or another shell? Are you running screen? Do you have anything else that may be using curses or doing some other screen manipulation? Do you have a trap set for Ctrl-C?

Related Question