Skip to content

Commit

Permalink
app-shells/bash: show full cwd for root user
Browse files Browse the repository at this point in the history
Though the first declaration of PS1 in this file uses \w uniformly for
root and non-root, the two subsequent ones inconsistently do not. Thus, a
normal user is able to see clearly where he is in the file system,
whereas the root user -- who should have this sort of visibility -- does
not, since \W (upper-case) is used instead. It seems clear that this
difference is just the result of an old bug; \w for both user types is
clearly more reasonable. This patch fixes things up as such.

Signed-off-by: Jason A. Donenfeld <[email protected]>
  • Loading branch information
zx2c4 committed Jun 10, 2017
1 parent 3de8db6 commit 1db68b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app-shells/bash/files/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fi

if ${use_color} ; then
if [[ ${EUID} == 0 ]] ; then
PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \w \$\[\033[00m\] '
else
PS1+='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
Expand All @@ -99,7 +99,7 @@ if ${use_color} ; then
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
PS1+='\u@\h \W \$ '
PS1+='\u@\h \w \$ '
else
PS1+='\u@\h \w \$ '
fi
Expand Down

0 comments on commit 1db68b9

Please sign in to comment.