In a terminal window any smaller than fullscreen, if I type in a long command it starts overwriting the current line I'm on. If I type an additional line's worth, it finally moves to the next line. Does anyone know how to fix this?
This is what happens visually:
Edit: These are my prompt settings:
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\033[1m`__git_ps1`\033[0m\$ '
TERM=xterm
.bashrc:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\033[1m`__git_ps1`\033[0m\$ '
fi
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac



shoptshows that checkwinsize is on. – Matt Baer Aug 04 '12 at 19:48PS1andTERM. In fact, post the line defining PS1 in.bashrc– Julian Knight Aug 08 '12 at 20:41\u@\h: \w\a\or justzzzzzzzzzzzzz>(just to keep it long). – Julian Knight Aug 10 '12 at 21:43\033[1m\__git_ps1`\033[0mwas causing it. By taking out the formatting (\033[1mand\033]0m`) I can keep the git branch in there and the text will wrap fine. Thanks for the help! – Matt Baer Aug 13 '12 at 18:57PS1set to\$viaPS1='\$ 'in the~/.bashrc. Turns out the use of single quotes confuses the backslash-escaped dollar sign in the PS1 assignment, readjusted to double-quotesPS1="\$ "- et voilà. Hope helps someone, quite a lot of frustration on my part to finally figure that one out. – muthuh Sep 25 '22 at 10:06