mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
bash: emulate zsh 'colors' behaviour (+compat 3.x)
This commit is contained in:
parent
c29d55e131
commit
ca5b9f0754
5 changed files with 147 additions and 92 deletions
10
bash/prompt
10
bash/prompt
|
|
@ -3,18 +3,18 @@ source "$DOTFILES_BASH_DIR/prompt_segments"
|
|||
source "$DOTFILES_SHELL_DIR/prompt_vcs"
|
||||
|
||||
prompt_host() {
|
||||
local bg='black'
|
||||
local fg='white'
|
||||
local host_bg='black'
|
||||
local host_fg='white'
|
||||
|
||||
if [[ $UID -eq 0 ]]; then
|
||||
bg='red'
|
||||
host_bg='red'
|
||||
fi
|
||||
|
||||
if [[ -n $SSH_CLIENT ]]; then
|
||||
fg='yellow'
|
||||
host_fg='yellow'
|
||||
fi
|
||||
|
||||
prompt_segment $bg $fg '\u@\h'
|
||||
prompt_segment $host_bg $host_fg '\u@\h'
|
||||
}
|
||||
|
||||
prompt_dir() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue