]> arthur.barton.de Git - ConfigScripts.git/commitdiff
PS1 shell prompt: only show current directory name
authorAlexander Barton <alex@barton.de>
Sun, 24 Aug 2014 17:26:01 +0000 (19:26 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 24 Aug 2014 17:26:01 +0000 (19:26 +0200)
Don't show the full path name any more, because it can become very long
and too wide for an 80 character terminal ...

sys/bashrc

index e2f26287c9826d0f128ebd41a8a4f09e5311d831..eb4799c3297e2596d19df44cb1eddbdd72c5d14f 100644 (file)
@@ -108,17 +108,12 @@ if ! shopt -oq posix; then
 fi
 
 # Shell prompt
-PS1_Path() {
-       P="${PWD/$HOME/~}"
-       echo "${P/???????????????????????????????*/${P:0:8}...${P: -20}}"
-}
-
 PS1="${COLOR_PREPOSTTXT}${PS1_BEGIN:-<}"
 [ "$LOGNAME" = "root" ] \
        || PS1="${PS1}${COLOR_USER}\u${COLOR_AT}@"
 PS1="${PS1}${COLOR_HOST}\h"
 PS1="${PS1}${COLOR_COLON}:"
-PS1="${PS1}${COLOR_PATH}\$(PS1_Path) "
+PS1="${PS1}${COLOR_PATH}\W "
 PS1="${PS1}${COLOR_HISTORY}\!"
 PS1="${PS1}${COLOR_PREPOSTTXT}${PS1_END:->}${COLOR_RESET} "
 [ "$LOGNAME" = "root" ] \