summaryrefslogtreecommitdiff
path: root/tw/home/files/prompt.zsh
diff options
context:
space:
mode:
authorTimo Wilken2023-06-29 23:05:17 +0200
committerTimo Wilken2023-06-29 23:05:17 +0200
commitccd82b623514c0be80ed154b6119ccbe1388121d (patch)
tree4f59a224d408a1265cafcb88ede3cb0b9fbd6790 /tw/home/files/prompt.zsh
parent52888f5ed8322562ff4ce1d4c4da14c98b2425cd (diff)
Improve prompt colouring if user is root
Diffstat (limited to 'tw/home/files/prompt.zsh')
-rw-r--r--tw/home/files/prompt.zsh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tw/home/files/prompt.zsh b/tw/home/files/prompt.zsh
index 7cc7342b..e582eb9b 100644
--- a/tw/home/files/prompt.zsh
+++ b/tw/home/files/prompt.zsh
@@ -89,7 +89,7 @@ prompt_fast_precmd () {
local genv_short=${GUIX_ENVIRONMENT##*/}
genv_short=${genv_short:0:5}
local italic=$'\e[03m'
- PROMPT="${TMUX+%F{green\}t }${GUIX_ENVIRONMENT+%F{11\}${genv_short}%u }$prompt_fast_jobs$prompt_fast_host%F{blue}$(prompt_fast_pwd)%F{8}$vcs_info_str$(prompt_fast_git_dirty) %F{yellow}$(prompt_fast_cmd_exec_time)%(?..%B%F{red}%?%f%b )%(?.%F{blue}.%B%F{red})$vimode%#%s%u%f%k%b "
+ PROMPT="${TMUX+%F{yellow\}t }${GUIX_ENVIRONMENT+%F{11\}${genv_short}%u }$prompt_fast_jobs$prompt_fast_host%F{blue}$(prompt_fast_pwd)%F{8}$vcs_info_str$(prompt_fast_git_dirty) %F{yellow}$(prompt_fast_cmd_exec_time)%(?..%B%F{red}%?%f%b )%(?.%F{blue}.%B%F{red})$vimode%#%s%u%f%k%b "
unset cmd_timestamp # reset value since `preexec` isn't always triggered
}
@@ -117,7 +117,10 @@ prompt_fast_setup () {
if [ -n "$SSH_CONNECTION" ]; then
prompt_fast_title_host=' - %n@%m'
- prompt_fast_host='%F{yellow}%n@%m:'
+ prompt_fast_host='%(!.%F{red}.%F{green})%n@%m:'
+ else
+ prompt_fast_title_host='%(!. - %n@%m.)'
+ prompt_fast_host='%(!.%F{red}%n@%m:.)'
fi
return 0