Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to define a host fg and bg color #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion agnoster.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,22 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
local user=`whoami`
local foreground background

if [[ -n $HOST_FG ]]; then
foreground=$HOST_FG
else
foreground=default
fi

if [[ -n $HOST_BG ]]; then
background=$HOST_BG
else
background=$PRIMARY_FG
fi

if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]]; then
prompt_segment $PRIMARY_FG default " %(!.%{%F{yellow}%}.)$user@%m "
prompt_segment $background $foreground " %(!.%{%F{yellow}%}.)$user@%m "
fi
}

Expand Down