prompt command enabled for bashrc
This commit is contained in:
parent
128dbc083b
commit
36839c9cd5
1 changed files with 26 additions and 13 deletions
39
bashrc
39
bashrc
|
@ -37,23 +37,36 @@ color_number=0
|
||||||
for color in 'black' 'red' 'green' 'yellow' 'blue' 'magenta' 'cyan' 'white'; do
|
for color in 'black' 'red' 'green' 'yellow' 'blue' 'magenta' 'cyan' 'white'; do
|
||||||
eval "n${color}='\[\e[0;3${color_number}m\]'"
|
eval "n${color}='\[\e[0;3${color_number}m\]'"
|
||||||
eval "b${color}='\[\e[1;3${color_number}m\]'"
|
eval "b${color}='\[\e[1;3${color_number}m\]'"
|
||||||
(( color_number++ ))
|
(( color_number++ ))
|
||||||
done
|
done
|
||||||
unset color_number
|
unset color_number
|
||||||
reset='\[\e[0m\]'
|
reset='\[\e[0m\]'
|
||||||
bold='\[\e[1m\]'
|
bold='\[\e[1m\]'
|
||||||
if [[ ${USER} == 'von' ]]; then
|
newline='
|
||||||
prompt_user=""
|
'
|
||||||
else
|
prompt_command()
|
||||||
prompt_user="${nred}\u${reset} "
|
{
|
||||||
fi
|
case ${TERM} in
|
||||||
if [[ $UID -eq 0 ]]; then
|
xterm*|rxvt*)
|
||||||
color_bang="${nred}"
|
printf "\033]0;%s@%s\007" "${USER}" "${HOSTNAME%%.*}"
|
||||||
else
|
;;
|
||||||
color_bang="${bold}"
|
screen*|tmux)
|
||||||
fi
|
printf "\033k%s@%s\033\\" "${USER}" "${HOSTNAME%%.*}"
|
||||||
PS1="[ ${prompt_user}${HOSTNAME}:${bold}\w${reset} ]
|
;;
|
||||||
${color_bang}>${reset} "
|
esac
|
||||||
|
if [[ ${USER} == 'von' ]]; then
|
||||||
|
prompt_user=""
|
||||||
|
else
|
||||||
|
prompt_user="${nred}\u${reset} "
|
||||||
|
fi
|
||||||
|
if [[ $UID -eq 0 ]]; then
|
||||||
|
color_bang="${nred}"
|
||||||
|
else
|
||||||
|
color_bang="${bold}"
|
||||||
|
fi
|
||||||
|
PS1="[ ${prompt_user}${HOSTNAME}:${bold}\w${reset} ]${newline}${color_bang}>${reset} "
|
||||||
|
}
|
||||||
|
PROMPT_COMMAND=prompt_command
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ key bindings
|
# {{{ key bindings
|
||||||
# urxvt
|
# urxvt
|
||||||
|
|
Loading…
Reference in a new issue