prompt command enabled for bashrc
This commit is contained in:
parent
128dbc083b
commit
36839c9cd5
1 changed files with 26 additions and 13 deletions
17
bashrc
17
bashrc
|
@ -42,6 +42,18 @@ done
|
||||||
unset color_number
|
unset color_number
|
||||||
reset='\[\e[0m\]'
|
reset='\[\e[0m\]'
|
||||||
bold='\[\e[1m\]'
|
bold='\[\e[1m\]'
|
||||||
|
newline='
|
||||||
|
'
|
||||||
|
prompt_command()
|
||||||
|
{
|
||||||
|
case ${TERM} in
|
||||||
|
xterm*|rxvt*)
|
||||||
|
printf "\033]0;%s@%s\007" "${USER}" "${HOSTNAME%%.*}"
|
||||||
|
;;
|
||||||
|
screen*|tmux)
|
||||||
|
printf "\033k%s@%s\033\\" "${USER}" "${HOSTNAME%%.*}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
if [[ ${USER} == 'von' ]]; then
|
if [[ ${USER} == 'von' ]]; then
|
||||||
prompt_user=""
|
prompt_user=""
|
||||||
else
|
else
|
||||||
|
@ -52,8 +64,9 @@ if [[ $UID -eq 0 ]]; then
|
||||||
else
|
else
|
||||||
color_bang="${bold}"
|
color_bang="${bold}"
|
||||||
fi
|
fi
|
||||||
PS1="[ ${prompt_user}${HOSTNAME}:${bold}\w${reset} ]
|
PS1="[ ${prompt_user}${HOSTNAME}:${bold}\w${reset} ]${newline}${color_bang}>${reset} "
|
||||||
${color_bang}>${reset} "
|
}
|
||||||
|
PROMPT_COMMAND=prompt_command
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ key bindings
|
# {{{ key bindings
|
||||||
# urxvt
|
# urxvt
|
||||||
|
|
Loading…
Reference in a new issue