git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #10390 from abbradar/bash-tramp

nixos/bash: use simple prompt for dumb terminals

commita9792367aaccd2566bfc726676388183a3eed4a1 authorNikolay Amiantov <ab@fmap.me> dateThu 22 Oct 2015, 14:07 (11 years ago) parentb5498df7a9982d
1 file changed+8−6
nixos/modules/programs/bash/bash.nix+8−6
nixos/modules/programs/bash/bash.nix+8−6
@@ -90,12 +90,14 @@ in
9090
9191 promptInit = mkOption {
9292 default = ''
93− # Provide a nice prompt.
94− PROMPT_COLOR="1;31m"
95− let $UID && PROMPT_COLOR="1;32m"
96− PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "
97− if test "$TERM" = "xterm"; then
98− PS1="\[\033]2;\h:\u:\w\007\]$PS1"
93+ if test "$TERM" != "dumb"; then
94+ # Provide a nice prompt.
95+ PROMPT_COLOR="1;31m"
96+ let $UID && PROMPT_COLOR="1;32m"
97+ PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "
98+ if test "$TERM" = "xterm"; then
99+ PS1="\[\033]2;\h:\u:\w\007\]$PS1"
100+ fi
99101 fi
100102 '';
101103 description = ''