Mac OS Terminal - keyboard echo breaks after ctrl-c with some applications

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?


This is a bug with MacPorts bash completion. The bug report is here.

I fixed it by changing my shell to /opt/local/bin/bash provided by macports, using this.


To summarize what Michael found: the stock MacOS Bash, v3.2.48(1)-release, plus bash_completion as supplied by MacPorts causes some commands (tail(1), cat(1), etc.) to disable TTY echo in the shell after they are terminated, as described in this bug. The fix is to use the MacPorts version of Bash, as describe here.

For what it's worth, I found the same bug when using bash-completion supplied by Homebrew with the stock version of Bash.