]> snippets.scripts.mit.edu Git - Scripts/git/.git/commit
newline-fix.bash: Force the bash prompt to start after a newline
authorAnders Kaseorg <andersk@mit.edu>
Tue, 15 Jun 2010 08:11:05 +0000 (04:11 -0400)
committerAnders Kaseorg <andersk@mit.edu>
Tue, 15 Jun 2010 08:11:05 +0000 (04:11 -0400)
commitbbe6be472aca29cfab26d0304b6eb36920968ac0
tree5727460b480f51d113ea108651ea5c029159d6a9
parentefbc574255759e74aa39d82e6dead82e8f0b52ce
newline-fix.bash: Force the bash prompt to start after a newline

Some commands don’t print a newline at the end of their output, or
take long enough to return that you’ve already typed part of the
next command.  Either causes bash to start its prompt in the middle
of a line, which confuses it.  This script sets $PROMPT_COMMAND to
echo a magic sequence of terminal commands that will display a red
“<no LF>\n” before the prompt if it would otherwise start in the
middle of a line.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
bash/newline-fix.bash [new file with mode: 0644]