Bash search prompt overlapping value
Clash 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
bash prompt
add a comment |Â
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
bash prompt
What terminal program are you using? What doesecho $TERM
say?
â Andy Dalton
Jun 25 at 22:05
1
This is not a problem with yourPS1
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 isxterm-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
add a comment |Â
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
bash prompt
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
bash prompt
edited Jun 25 at 22:42
asked Jun 25 at 21:15
treeface
1114
1114
What terminal program are you using? What doesecho $TERM
say?
â Andy Dalton
Jun 25 at 22:05
1
This is not a problem with yourPS1
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 isxterm-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
add a comment |Â
What terminal program are you using? What doesecho $TERM
say?
â Andy Dalton
Jun 25 at 22:05
1
This is not a problem with yourPS1
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 isxterm-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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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