2

When I scroll through the bash history with the arrow keys and hit (for example) the following string:

git clone hgit clone https://github.com/electron/electron-quick-start

In the next line of history I get something like this:

git clone hls

Where ls is the command from history and git clone h is my unwanted artifact.

The following lines from .bashrc are suspect:

PROMPT_DIRTRIM=2
YELLOW="\[\033[0;33m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
ORANGE="\033[38;5;208m"
PROMPT_COMMAND='echo -ne "\033]0; ${USER}@${HOST}\007"'
PS1="${YELLOW}\u@\h:${ORANGE}\w ${GREEN}\$ "
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

1 Answers1

5

Your ORANGE is misformed. Instead of this:

ORANGE="\033[38;5;208m"

It should be, as shown below, just like the others:

ORANGE="\[\033[38;5;208m\]"
terdon
  • 242,166