mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Added some comments to make it more clear.
This commit is contained in:
parent
e5b4c46153
commit
f4fb47b2e0
1 changed files with 5 additions and 5 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
# PRODUCTION_RE='^prod-'
|
# PRODUCTION_RE='^prod-'
|
||||||
# And for yellow:
|
# And for yellow:
|
||||||
# STAGING_RE='^staging-'
|
# STAGING_RE='^staging-'
|
||||||
|
# The contents are regular expression against which the host is matched,
|
||||||
|
|
||||||
# Default user colour
|
# Default user colour
|
||||||
us_col=$fg[green]
|
us_col=$fg[green]
|
||||||
|
|
@ -16,19 +17,18 @@ if [[ `whoami` == 'root' ]]; then
|
||||||
us_col=$fg[red]
|
us_col=$fg[red]
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Default host colour.
|
||||||
|
|
||||||
|
|
||||||
host_col=$fg[green]
|
host_col=$fg[green]
|
||||||
local hostname=`hostname`
|
local hostname=`hostname`
|
||||||
|
|
||||||
|
# Set the host colour red if it matches the production regex.
|
||||||
if [[ "$PRODUCTION_RE" != "" && "$hostname" =~ "$PRODUCTION_RE" ]]; then
|
if [[ "$PRODUCTION_RE" != "" && "$hostname" =~ "$PRODUCTION_RE" ]]; then
|
||||||
host_col=$fg[red]
|
host_col=$fg[red]
|
||||||
|
# And yellow if it matches the staging regex.
|
||||||
elif [[ "$STAGING_RE" != "" && $hostname =~ $STAGING_RE ]]; then
|
elif [[ "$STAGING_RE" != "" && $hostname =~ $STAGING_RE ]]; then
|
||||||
host_col=$fg[yellow]
|
host_col=$fg[yellow]
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local start_angular="%{$fg_bold[white]%}[%{$reset_color%}"
|
local start_angular="%{$fg_bold[white]%}[%{$reset_color%}"
|
||||||
local user_at_host="%{$us_col%}%n%{$reset_color%}%{$fg_bold[yellow]%}@%{$reset_color%}%{$host_col%}%m%{$reset_color%}"
|
local user_at_host="%{$us_col%}%n%{$reset_color%}%{$fg_bold[yellow]%}@%{$reset_color%}%{$host_col%}%m%{$reset_color%}"
|
||||||
local current_path="%{$fg[cyan]%}%2c%{$reset_color%}"
|
local current_path="%{$fg[cyan]%}%2c%{$reset_color%}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue