Improve bash prompt
This commit is contained in:
@@ -98,11 +98,14 @@
|
|||||||
|
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
promptInit = ''
|
promptInit = ''
|
||||||
PROMPT_COLOR="1;31m"
|
PS1="\[\e]0;\u@\h: \w\a\]" # window title
|
||||||
((UID)) && PROMPT_COLOR="1;32m"
|
PS1+="\n"
|
||||||
BASE_PROMPT="💜\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] "
|
PS1+="\$(printf \"%*s\" \$((\$COLUMNS + 9)) \"\[\e[1;33m\]\$(git branch --show-current 2>/dev/null)\")" # git branch
|
||||||
BRANCH="\$(git branch --show-current 2>/dev/null)"
|
PS1+="\[\e[1G\]" # move cursor to beginning of line
|
||||||
PS1="\n\[$(tput sc)\$([ -n "$BRANCH" ] && printf "%*s" $COLUMNS "$BRANCH")\$(tput rc)\]$BASE_PROMPT"
|
PS1+="💜" # prompt symbol
|
||||||
|
PS1+="\[\033[1;$((UID ? 32 : 31))m\]" # prompt color
|
||||||
|
PS1+="[\u@\h:\w]\\$"
|
||||||
|
PS1+="\[\033[0m\] " # reset color
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user