bash-git-prompt icon indicating copy to clipboard operation
bash-git-prompt copied to clipboard

^c, scroll back x2 then forward to empty cmd line deletes last 2 characters of prompt

Open adudek16 opened this issue 6 years ago • 1 comments

Title seems wonky. This is situation. Normal prompt looks tempus:~ adudek$_ with a space after $. I run a command that I then kill with ^c. I then scroll (up arrow) back twice to look at the previous command, then forward (down arrow) twice to empty prompt, I lose the "$_" eg:

tempus:~ adudek$ scp 192.168.111.1:textfiles.tar.gz textfiles.tar.gz
^Ctempus:~ adudekls -la

This seems to be around how we are handling the default prompt as this issue is not present if I am in a git branch.

PATH=/usr/local/sbin/:/usr/local/opt/openssl/bin:/Applications/MacVim.app/Contents/bin:$PATH:/Users/adudek/bin
HISTSIZE=5000
HISTFILESIZE=50000
HISTCONTROL=ignoredups:erasedups
#export HISTIGNORE="&:pwd:ls:[bf]g:exit:[ \t]*"
HISTTIMEFORMAT="%d/%m/%y-%T "
#shopt -s cmdhist
#shopt -s histappend
#export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
#export PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
alias ls='ls -Gp'
#testing git prompt
source ~/.git-prompt.sh
PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
GIT_PROMPT_ONLY_IN_REPO=1 # Use the default prompt when not in a git repo.
GIT_PROMPT_FETCH_REMOTE_STATUS=0 # Avoid fetching remote status
GIT_PROMPT_SHOW_UPSTREAM=0 # Don't display upstream tracking branch
GIT_SHOW_UNTRACKED_FILES=no # Don't count untracked files (no, normal, all)
#To select a theme, set the variable GIT_PROMPT_THEME to the name of the theme located in <INSTALLDIR>/themes without the extension .bgptheme
GIT_PROMPT_THEME=Single_line

if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
  __GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
  source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi

adudek16 avatar Mar 20 '19 12:03 adudek16

This is on OSX 10.14.3. git version 2.17.2 (Apple Git-113)

tempus:share adudek$ brew list --versions | grep bash-git
bash-git-prompt 2.7.1

adudek16 avatar Mar 20 '19 12:03 adudek16