Bash search prompt overlapping value

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Running a docker alpine container, my PS1 is:



PS1="u@h:w$ "


So when logging into the container, you get



root@worker:/$


So if I type in something like



root@worker:/$ cd /tmp/dir/path


And then do a reverse-i-search for tmp/di



The prompt looks like this for each character along the way:



(reverse-i-search)`t': cd /tmp/dir/path
(reverse-i-search)`tm: cd /tmp/dir/path
(reverse-i-search)`tmp cd /tmp/dir/path
(reverse-i-search)`tmp/cd /tmp/dir/path
(reverse-i-search)`tmp/dd /tmp/dir/path
(reverse-i-search)`tmp/di /tmp/dir/path


So now that I've typed tmp/di, if I hit the end key the prompt looks like this:



root@worker:/$tmp/dir/path


Worth noting that if I hit enter it performs the correct command, and if I scroll back through the history, it shows the correct command, so it's clearly just something to do with the presentation.



I'm wondering if this is a problem with my PS1 or if I've done something else wrong.



Thank you!



Edit:



Here is the entire .bashrc



PS1="u@h:w$ "
alias app='cd /var/www/pricing'

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# append to the history file, don't overwrite it
shopt -s histappend
shopt -s checkwinsize

case "$TERM" in
xterm-color) color_prompt=yes;;
esac






share|improve this question





















  • What terminal program are you using? What does echo $TERM say?
    – Andy Dalton
    Jun 25 at 22:05






  • 1




    This is not a problem with your PS1 as written above; it will not cause this behavior unless you are adding in non-printing characters such as coloration or effects.
    – jeremysprofile
    Jun 25 at 22:05










  • The $TERM is xterm-color. I've also edited the post to include the full .bashrc. I'm using cmder on windows, but the problem also arises when using a normal windows command prompt.
    – treeface
    Jun 25 at 22:43














up vote
2
down vote

favorite












Running a docker alpine container, my PS1 is:



PS1="u@h:w$ "


So when logging into the container, you get



root@worker:/$


So if I type in something like



root@worker:/$ cd /tmp/dir/path


And then do a reverse-i-search for tmp/di



The prompt looks like this for each character along the way:



(reverse-i-search)`t': cd /tmp/dir/path
(reverse-i-search)`tm: cd /tmp/dir/path
(reverse-i-search)`tmp cd /tmp/dir/path
(reverse-i-search)`tmp/cd /tmp/dir/path
(reverse-i-search)`tmp/dd /tmp/dir/path
(reverse-i-search)`tmp/di /tmp/dir/path


So now that I've typed tmp/di, if I hit the end key the prompt looks like this:



root@worker:/$tmp/dir/path


Worth noting that if I hit enter it performs the correct command, and if I scroll back through the history, it shows the correct command, so it's clearly just something to do with the presentation.



I'm wondering if this is a problem with my PS1 or if I've done something else wrong.



Thank you!



Edit:



Here is the entire .bashrc



PS1="u@h:w$ "
alias app='cd /var/www/pricing'

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# append to the history file, don't overwrite it
shopt -s histappend
shopt -s checkwinsize

case "$TERM" in
xterm-color) color_prompt=yes;;
esac






share|improve this question





















  • What terminal program are you using? What does echo $TERM say?
    – Andy Dalton
    Jun 25 at 22:05






  • 1




    This is not a problem with your PS1 as written above; it will not cause this behavior unless you are adding in non-printing characters such as coloration or effects.
    – jeremysprofile
    Jun 25 at 22:05










  • The $TERM is xterm-color. I've also edited the post to include the full .bashrc. I'm using cmder on windows, but the problem also arises when using a normal windows command prompt.
    – treeface
    Jun 25 at 22:43












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Running a docker alpine container, my PS1 is:



PS1="u@h:w$ "


So when logging into the container, you get



root@worker:/$


So if I type in something like



root@worker:/$ cd /tmp/dir/path


And then do a reverse-i-search for tmp/di



The prompt looks like this for each character along the way:



(reverse-i-search)`t': cd /tmp/dir/path
(reverse-i-search)`tm: cd /tmp/dir/path
(reverse-i-search)`tmp cd /tmp/dir/path
(reverse-i-search)`tmp/cd /tmp/dir/path
(reverse-i-search)`tmp/dd /tmp/dir/path
(reverse-i-search)`tmp/di /tmp/dir/path


So now that I've typed tmp/di, if I hit the end key the prompt looks like this:



root@worker:/$tmp/dir/path


Worth noting that if I hit enter it performs the correct command, and if I scroll back through the history, it shows the correct command, so it's clearly just something to do with the presentation.



I'm wondering if this is a problem with my PS1 or if I've done something else wrong.



Thank you!



Edit:



Here is the entire .bashrc



PS1="u@h:w$ "
alias app='cd /var/www/pricing'

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# append to the history file, don't overwrite it
shopt -s histappend
shopt -s checkwinsize

case "$TERM" in
xterm-color) color_prompt=yes;;
esac






share|improve this question













Running a docker alpine container, my PS1 is:



PS1="u@h:w$ "


So when logging into the container, you get



root@worker:/$


So if I type in something like



root@worker:/$ cd /tmp/dir/path


And then do a reverse-i-search for tmp/di



The prompt looks like this for each character along the way:



(reverse-i-search)`t': cd /tmp/dir/path
(reverse-i-search)`tm: cd /tmp/dir/path
(reverse-i-search)`tmp cd /tmp/dir/path
(reverse-i-search)`tmp/cd /tmp/dir/path
(reverse-i-search)`tmp/dd /tmp/dir/path
(reverse-i-search)`tmp/di /tmp/dir/path


So now that I've typed tmp/di, if I hit the end key the prompt looks like this:



root@worker:/$tmp/dir/path


Worth noting that if I hit enter it performs the correct command, and if I scroll back through the history, it shows the correct command, so it's clearly just something to do with the presentation.



I'm wondering if this is a problem with my PS1 or if I've done something else wrong.



Thank you!



Edit:



Here is the entire .bashrc



PS1="u@h:w$ "
alias app='cd /var/www/pricing'

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# append to the history file, don't overwrite it
shopt -s histappend
shopt -s checkwinsize

case "$TERM" in
xterm-color) color_prompt=yes;;
esac








share|improve this question












share|improve this question




share|improve this question








edited Jun 25 at 22:42
























asked Jun 25 at 21:15









treeface

1114




1114











  • What terminal program are you using? What does echo $TERM say?
    – Andy Dalton
    Jun 25 at 22:05






  • 1




    This is not a problem with your PS1 as written above; it will not cause this behavior unless you are adding in non-printing characters such as coloration or effects.
    – jeremysprofile
    Jun 25 at 22:05










  • The $TERM is xterm-color. I've also edited the post to include the full .bashrc. I'm using cmder on windows, but the problem also arises when using a normal windows command prompt.
    – treeface
    Jun 25 at 22:43
















  • What terminal program are you using? What does echo $TERM say?
    – Andy Dalton
    Jun 25 at 22:05






  • 1




    This is not a problem with your PS1 as written above; it will not cause this behavior unless you are adding in non-printing characters such as coloration or effects.
    – jeremysprofile
    Jun 25 at 22:05










  • The $TERM is xterm-color. I've also edited the post to include the full .bashrc. I'm using cmder on windows, but the problem also arises when using a normal windows command prompt.
    – treeface
    Jun 25 at 22:43















What terminal program are you using? What does echo $TERM say?
– Andy Dalton
Jun 25 at 22:05




What terminal program are you using? What does echo $TERM say?
– Andy Dalton
Jun 25 at 22:05




1




1




This is not a problem with your PS1 as written above; it will not cause this behavior unless you are adding in non-printing characters such as coloration or effects.
– jeremysprofile
Jun 25 at 22:05




This is not a problem with your PS1 as written above; it will not cause this behavior unless you are adding in non-printing characters such as coloration or effects.
– jeremysprofile
Jun 25 at 22:05












The $TERM is xterm-color. I've also edited the post to include the full .bashrc. I'm using cmder on windows, but the problem also arises when using a normal windows command prompt.
– treeface
Jun 25 at 22:43




The $TERM is xterm-color. I've also edited the post to include the full .bashrc. I'm using cmder on windows, but the problem also arises when using a normal windows command prompt.
– treeface
Jun 25 at 22:43















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451856%2fbash-search-prompt-overlapping-value%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451856%2fbash-search-prompt-overlapping-value%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay