nixos/bash: use simple prompt for dumb terminals

This commit is contained in:
Nikolay Amiantov 2015-10-14 18:15:11 +03:00
parent 7b001ed68a
commit 7a9982d465

View File

@ -90,12 +90,14 @@ in
promptInit = mkOption { promptInit = mkOption {
default = '' default = ''
# Provide a nice prompt. if test "$TERM" != "dumb"; then
PROMPT_COLOR="1;31m" # Provide a nice prompt.
let $UID && PROMPT_COLOR="1;32m" PROMPT_COLOR="1;31m"
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " let $UID && PROMPT_COLOR="1;32m"
if test "$TERM" = "xterm"; then PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "
PS1="\[\033]2;\h:\u:\w\007\]$PS1" if test "$TERM" = "xterm"; then
PS1="\[\033]2;\h:\u:\w\007\]$PS1"
fi
fi fi
''; '';
description = '' description = ''