Cannot export PS1 over SSH
up vote
1
down vote
favorite
Trying to customize shell prompt on a Ubuntu 18 LTS server over SSH.
On the server, the .profile sources .bashrc correctly, and .bashrc has force_color_prompt=yes uncommented. The prompt is not colored.
Tried setting it manually. It does not export:
user@ubuntu ~ $ export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
user@ubuntu ~ $ echo $PS1
u@h w $
But as root it works fine:
user@ubuntu ~ $ sudo su
root@ubuntu:/home/user# export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
[ root is awesome: /home/user ]#
What is going on?
bash ssh bashrc prompt
add a comment |
up vote
1
down vote
favorite
Trying to customize shell prompt on a Ubuntu 18 LTS server over SSH.
On the server, the .profile sources .bashrc correctly, and .bashrc has force_color_prompt=yes uncommented. The prompt is not colored.
Tried setting it manually. It does not export:
user@ubuntu ~ $ export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
user@ubuntu ~ $ echo $PS1
u@h w $
But as root it works fine:
user@ubuntu ~ $ sudo su
root@ubuntu:/home/user# export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
[ root is awesome: /home/user ]#
What is going on?
bash ssh bashrc prompt
Perhaps your ordinary user's login shell is not bash?
– steeldriver
Nov 28 at 17:06
1
Please edit your question and show us the output ofecho $PROMPT_COMMAND. Ideally, show us the entire contents of your~/.bashrc. Also show us the output ofps -p $$as your regular user. @steeldriver are there any shells that accept thefoo=barsyntax for variables and don't supportPS1? It's defined by POSIX forshso I would be very surprised to find an sh-like shell that doesn't understand it.
– terdon♦
Nov 28 at 17:55
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Trying to customize shell prompt on a Ubuntu 18 LTS server over SSH.
On the server, the .profile sources .bashrc correctly, and .bashrc has force_color_prompt=yes uncommented. The prompt is not colored.
Tried setting it manually. It does not export:
user@ubuntu ~ $ export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
user@ubuntu ~ $ echo $PS1
u@h w $
But as root it works fine:
user@ubuntu ~ $ sudo su
root@ubuntu:/home/user# export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
[ root is awesome: /home/user ]#
What is going on?
bash ssh bashrc prompt
Trying to customize shell prompt on a Ubuntu 18 LTS server over SSH.
On the server, the .profile sources .bashrc correctly, and .bashrc has force_color_prompt=yes uncommented. The prompt is not colored.
Tried setting it manually. It does not export:
user@ubuntu ~ $ export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
user@ubuntu ~ $ echo $PS1
u@h w $
But as root it works fine:
user@ubuntu ~ $ sudo su
root@ubuntu:/home/user# export PS1="[ ${debian_chroot:+($debian_chroot)}u is awesome: w ]\$ "
[ root is awesome: /home/user ]#
What is going on?
bash ssh bashrc prompt
bash ssh bashrc prompt
edited Nov 28 at 17:55
terdon♦
63.5k12133210
63.5k12133210
asked Nov 28 at 16:38
Sqerstet
183211
183211
Perhaps your ordinary user's login shell is not bash?
– steeldriver
Nov 28 at 17:06
1
Please edit your question and show us the output ofecho $PROMPT_COMMAND. Ideally, show us the entire contents of your~/.bashrc. Also show us the output ofps -p $$as your regular user. @steeldriver are there any shells that accept thefoo=barsyntax for variables and don't supportPS1? It's defined by POSIX forshso I would be very surprised to find an sh-like shell that doesn't understand it.
– terdon♦
Nov 28 at 17:55
add a comment |
Perhaps your ordinary user's login shell is not bash?
– steeldriver
Nov 28 at 17:06
1
Please edit your question and show us the output ofecho $PROMPT_COMMAND. Ideally, show us the entire contents of your~/.bashrc. Also show us the output ofps -p $$as your regular user. @steeldriver are there any shells that accept thefoo=barsyntax for variables and don't supportPS1? It's defined by POSIX forshso I would be very surprised to find an sh-like shell that doesn't understand it.
– terdon♦
Nov 28 at 17:55
Perhaps your ordinary user's login shell is not bash?
– steeldriver
Nov 28 at 17:06
Perhaps your ordinary user's login shell is not bash?
– steeldriver
Nov 28 at 17:06
1
1
Please edit your question and show us the output of
echo $PROMPT_COMMAND. Ideally, show us the entire contents of your ~/.bashrc. Also show us the output of ps -p $$ as your regular user. @steeldriver are there any shells that accept the foo=bar syntax for variables and don't support PS1? It's defined by POSIX for sh so I would be very surprised to find an sh-like shell that doesn't understand it.– terdon♦
Nov 28 at 17:55
Please edit your question and show us the output of
echo $PROMPT_COMMAND. Ideally, show us the entire contents of your ~/.bashrc. Also show us the output of ps -p $$ as your regular user. @steeldriver are there any shells that accept the foo=bar syntax for variables and don't support PS1? It's defined by POSIX for sh so I would be very surprised to find an sh-like shell that doesn't understand it.– terdon♦
Nov 28 at 17:55
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Checked $PROMPT_COMMAND as advised by @terdon:
user@ubuntu ~ $ echo $PROMPT_COMMAND
__git_ps1 "u@h w" "$(__drush_ps1 "[%s]") \$ "
Then looked harder at .bashrc and found:
# Include Drush prompt customizations.
if [ -f "/home/user/.drush/drush.prompt.sh" ] ; then
source /home/user/.drush/drush.prompt.sh
fi
Drush was setting its own $PROMPT_COMMAND, apparently instead of PS1. Not sure how PS1 gets overwritten by this, but it does. Commenting out Drush's superfluous customization makes the problem go away. Thanks to @terdon.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Checked $PROMPT_COMMAND as advised by @terdon:
user@ubuntu ~ $ echo $PROMPT_COMMAND
__git_ps1 "u@h w" "$(__drush_ps1 "[%s]") \$ "
Then looked harder at .bashrc and found:
# Include Drush prompt customizations.
if [ -f "/home/user/.drush/drush.prompt.sh" ] ; then
source /home/user/.drush/drush.prompt.sh
fi
Drush was setting its own $PROMPT_COMMAND, apparently instead of PS1. Not sure how PS1 gets overwritten by this, but it does. Commenting out Drush's superfluous customization makes the problem go away. Thanks to @terdon.
add a comment |
up vote
0
down vote
Checked $PROMPT_COMMAND as advised by @terdon:
user@ubuntu ~ $ echo $PROMPT_COMMAND
__git_ps1 "u@h w" "$(__drush_ps1 "[%s]") \$ "
Then looked harder at .bashrc and found:
# Include Drush prompt customizations.
if [ -f "/home/user/.drush/drush.prompt.sh" ] ; then
source /home/user/.drush/drush.prompt.sh
fi
Drush was setting its own $PROMPT_COMMAND, apparently instead of PS1. Not sure how PS1 gets overwritten by this, but it does. Commenting out Drush's superfluous customization makes the problem go away. Thanks to @terdon.
add a comment |
up vote
0
down vote
up vote
0
down vote
Checked $PROMPT_COMMAND as advised by @terdon:
user@ubuntu ~ $ echo $PROMPT_COMMAND
__git_ps1 "u@h w" "$(__drush_ps1 "[%s]") \$ "
Then looked harder at .bashrc and found:
# Include Drush prompt customizations.
if [ -f "/home/user/.drush/drush.prompt.sh" ] ; then
source /home/user/.drush/drush.prompt.sh
fi
Drush was setting its own $PROMPT_COMMAND, apparently instead of PS1. Not sure how PS1 gets overwritten by this, but it does. Commenting out Drush's superfluous customization makes the problem go away. Thanks to @terdon.
Checked $PROMPT_COMMAND as advised by @terdon:
user@ubuntu ~ $ echo $PROMPT_COMMAND
__git_ps1 "u@h w" "$(__drush_ps1 "[%s]") \$ "
Then looked harder at .bashrc and found:
# Include Drush prompt customizations.
if [ -f "/home/user/.drush/drush.prompt.sh" ] ; then
source /home/user/.drush/drush.prompt.sh
fi
Drush was setting its own $PROMPT_COMMAND, apparently instead of PS1. Not sure how PS1 gets overwritten by this, but it does. Commenting out Drush's superfluous customization makes the problem go away. Thanks to @terdon.
answered Nov 29 at 2:27
Sqerstet
183211
183211
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1096867%2fcannot-export-ps1-over-ssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Perhaps your ordinary user's login shell is not bash?
– steeldriver
Nov 28 at 17:06
1
Please edit your question and show us the output of
echo $PROMPT_COMMAND. Ideally, show us the entire contents of your~/.bashrc. Also show us the output ofps -p $$as your regular user. @steeldriver are there any shells that accept thefoo=barsyntax for variables and don't supportPS1? It's defined by POSIX forshso I would be very surprised to find an sh-like shell that doesn't understand it.– terdon♦
Nov 28 at 17:55