theme/essential: cleanup
Lose a couple of useless `echo`s/subshells. Alsö, lose the incorrect VIM modeline from the bottom. Our formatting standard is specified in `$BASH_IT/.EditorConfig`.pull/2012/head
parent
d1b7166358
commit
3695862b43
|
|
@ -12,7 +12,7 @@ function _user-prompt() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print the current user's name (colored according to their current EUID):
|
# Print the current user's name (colored according to their current EUID):
|
||||||
echo -e "${user_color}${user}${normal?}"
|
echo -ne "${user_color}${user}${normal?}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _host-prompt() {
|
function _host-prompt() {
|
||||||
|
|
@ -28,12 +28,14 @@ function _host-prompt() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print the current hostname (colored according to $SSH_TTY's status):
|
# Print the current hostname (colored according to $SSH_TTY's status):
|
||||||
echo -e "${host_color}${host}${normal?}"
|
echo -ne "${host_color}${host}${normal?}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _user-at-host-prompt() {
|
function _user-at-host-prompt() {
|
||||||
# Concatenate the user and host prompts into: user@host:
|
# Concatenate the user and host prompts into: user@host:
|
||||||
echo -e "$(_user-prompt)${bold_white?}@$(_host-prompt)"
|
_user-prompt
|
||||||
|
echo -ne "${bold_white?}@"
|
||||||
|
_host-prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
function _exit-status-prompt() {
|
function _exit-status-prompt() {
|
||||||
|
|
@ -54,27 +56,28 @@ function _exit-status-prompt() {
|
||||||
echo -ne "${exit_status_color}"
|
echo -ne "${exit_status_color}"
|
||||||
if [[ "${prompt_string}" -eq 1 ]]; then
|
if [[ "${prompt_string}" -eq 1 ]]; then
|
||||||
# $PS1:
|
# $PS1:
|
||||||
echo -e " +${normal?} "
|
echo -ne " +${normal?} "
|
||||||
elif [[ "${prompt_string}" -eq 2 ]]; then
|
elif [[ "${prompt_string}" -eq 2 ]]; then
|
||||||
# $PS2:
|
# $PS2:
|
||||||
echo -e " |${normal?} "
|
echo -ne " |${normal?} "
|
||||||
else
|
else
|
||||||
# Default:
|
# Default:
|
||||||
echo -e " ?${normal?} "
|
echo -ne " ?${normal?} "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function _ps1() {
|
function _ps1() {
|
||||||
local -r time='\\t'
|
local -r time='\\t'
|
||||||
|
local -r pwd='\\w'
|
||||||
|
|
||||||
echo -ne "${bold_white?}${time} "
|
echo -ne "${bold_white?}${time} "
|
||||||
echo -ne "$(_user-at-host-prompt)"
|
_user-at-host-prompt
|
||||||
echo -e "${bold_white?}:${normal?}${PWD}"
|
echo -e "${bold_white?}:${normal?}${pwd}"
|
||||||
echo -e "$(_exit-status-prompt 1 "${exit_status}")"
|
_exit-status-prompt 1 "${exit_status}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _ps2() {
|
function _ps2() {
|
||||||
echo -e "$(_exit-status-prompt 2 "${exit_status}")"
|
_exit-status-prompt 2 "${exit_status}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function prompt_command() {
|
function prompt_command() {
|
||||||
|
|
@ -89,5 +92,3 @@ function prompt_command() {
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_append_prompt_command prompt_command
|
safe_append_prompt_command prompt_command
|
||||||
|
|
||||||
# vim: sw=2 ts=2 et:
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue