A few times now, I've had Mac OS X Terminal end up in an odd state, whereby newlines aren't interpreted as they normally are. It's as if they're doing the line feed part, but not the carriage return. For example, I might ordinarily see something like this:
% git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
But when Terminal ends up in this odd mode, I get this instead:
% git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
I can create a new Terminal window to fix this, but that's a bit annoying. I'd like to keep the same window active, if possible, in case I need something in the scrollback buffer. Is there something I can do to fix things in place when it goes wrong like this?
(I don't know if it's relevant, but I normally get this when quitting emacs. Every now and again, I do something wrong, and select another command by accident instead of C-x C-c
. My fingers cancel it before I've even realised what's going on, so I don't know which command it might be, but once emacs has gone, the terminal is in this funny new mode.)