fixes
This commit is contained in:
parent
72964cbaee
commit
bae9daf731
3 changed files with 31 additions and 23 deletions
|
|
@ -10,6 +10,9 @@ _lp_liquidship_theme_activate() {
|
||||||
__lp_foreground_color 11
|
__lp_foreground_color 11
|
||||||
local YELLOW="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}"
|
local YELLOW="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}"
|
||||||
|
|
||||||
|
__lp_foreground_color 9
|
||||||
|
local RED="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}"
|
||||||
|
|
||||||
NO_COL="${_LP_OPEN_ESC}${_LP_TI_RESET-}${_LP_CLOSE_ESC}"
|
NO_COL="${_LP_OPEN_ESC}${_LP_TI_RESET-}${_LP_CLOSE_ESC}"
|
||||||
|
|
||||||
# Liquid Prompt reconfig
|
# Liquid Prompt reconfig
|
||||||
|
|
@ -50,7 +53,7 @@ _lp_liquidship_theme_activate() {
|
||||||
# The user or connection type is not expected to change from inside the
|
# The user or connection type is not expected to change from inside the
|
||||||
# shell, so we build this just once.
|
# shell, so we build this just once.
|
||||||
if _lp_username_color; then
|
if _lp_username_color; then
|
||||||
LP_USER="$lp_username_color in "
|
LP_USER="$lp_username_color"
|
||||||
else
|
else
|
||||||
LP_USER=
|
LP_USER=
|
||||||
fi
|
fi
|
||||||
|
|
@ -62,7 +65,7 @@ _lp_liquidship_theme_activate() {
|
||||||
if _lp_multiplexer; then
|
if _lp_multiplexer; then
|
||||||
LP_LIQUIDSHIP_MUX="in ${LP_COLOR_IN_MULTIPLEXER}${LP_LIQUIDSHIP_MARK_MUX}${NO_COL} "
|
LP_LIQUIDSHIP_MUX="in ${LP_COLOR_IN_MULTIPLEXER}${LP_LIQUIDSHIP_MARK_MUX}${NO_COL} "
|
||||||
else
|
else
|
||||||
LP_LIQUIDSHIP_MARK_MUX=
|
LP_LIQUIDSHIP_MUX=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_lp_terminal_device
|
_lp_terminal_device
|
||||||
|
|
@ -118,6 +121,8 @@ _lp_liquidship_theme_prompt_data() {
|
||||||
if _lp_sudo_active_color; then
|
if _lp_sudo_active_color; then
|
||||||
# LP_COLOR_MARK="$lp_sudo_active_color"
|
# LP_COLOR_MARK="$lp_sudo_active_color"
|
||||||
LP_LIQUIDSHIP_SUDO="${LP_COLOR_MARK_SUDO}${LP_LIQUIDSHIP_MARK_SUDO}${NO_COL} "
|
LP_LIQUIDSHIP_SUDO="${LP_COLOR_MARK_SUDO}${LP_LIQUIDSHIP_MARK_SUDO}${NO_COL} "
|
||||||
|
else
|
||||||
|
LP_LIQUIDSHIP_SUDO=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _lp_dirstack_color; then
|
if _lp_dirstack_color; then
|
||||||
|
|
@ -234,9 +239,9 @@ _lp_liquidship_theme_prompt_template() {
|
||||||
if [[ -z "${LP_PS1-}" ]]; then
|
if [[ -z "${LP_PS1-}" ]]; then
|
||||||
# Docker is displayed along with Singularity and Kubernetes (strange that it is not the case in Starship…),
|
# Docker is displayed along with Singularity and Kubernetes (strange that it is not the case in Starship…),
|
||||||
# in the container section, which is not duplicated at the end, like in Starship (WTF?).
|
# in the container section, which is not duplicated at the end, like in Starship (WTF?).
|
||||||
local n='\n'
|
local n=$'\n'
|
||||||
PS1="${LP_USER}${LP_HOST}${LP_LIQUIDSHIP_MUX}${LP_SHLVL}${LP_DIRSTACK}at ${LP_PWD}${LP_PERM} ${LP_VCS}${LP_CONTAINER}${LP_KUBECONTEXT}${LP_CMAKE}${LP_NODE_VENV}${LP_VENV}${LP_TFSPACE}${LP_AWS_PROFILE}${LP_PROXY}${LP_PS1_POSTFIX}${LP_RUNTIME}${n}"
|
PS1="${LP_USER}${LP_HOST}${LP_LIQUIDSHIP_MUX}${LP_SHLVL}${LP_DIRSTACK}at ${LP_PWD}${LP_PERM} ${LP_VCS}${LP_CONTAINER}${LP_KUBECONTEXT}${LP_CMAKE}${LP_NODE_VENV}${LP_VENV}${LP_TFSPACE}${LP_AWS_PROFILE}${LP_PROXY}${LP_PS1_POSTFIX}${LP_RUNTIME}${n}"
|
||||||
PS1+="${LP_TIME}${LP_WIFI}${LP_TEMP}${LP_LOAD}${LP_BATTERY}${LP_JOBS}${LP_LIQUIDSHIP_SUDO}${LP_ERR}${LP_COLOR_MARK}${LP_MARK}"
|
PS1+="${LP_TIME}${LP_WIFI}${LP_TEMP}${LP_LOAD}${LP_BATT}${LP_JOBS}${LP_LIQUIDSHIP_SUDO}${LP_ERR}${LP_COLOR_MARK}${LP_MARK}"
|
||||||
|
|
||||||
# Get the core sections without prompt escapes and make them into a title.
|
# Get the core sections without prompt escapes and make them into a title.
|
||||||
_lp_formatted_title "${LP_PS1_PREFIX}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_MARK_PERM}${lp_path-}${LP_BRACKET_CLOSE}${LP_MARK_PREFIX}${LP_SHLVL}${LP_MARK}${LP_PS1_POSTFIX}"
|
_lp_formatted_title "${LP_PS1_PREFIX}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_MARK_PERM}${lp_path-}${LP_BRACKET_CLOSE}${LP_MARK_PREFIX}${LP_SHLVL}${LP_MARK}${LP_PS1_POSTFIX}"
|
||||||
|
|
@ -249,33 +254,33 @@ _lp_liquidship_theme_prompt_template() {
|
||||||
|
|
||||||
_lp_liquidship_hostname_color() {
|
_lp_liquidship_hostname_color() {
|
||||||
if _lp_connected_display; then
|
if _lp_connected_display; then
|
||||||
lp_hostname_color="with ${LP_COLOR_X11_ON}X${NO_COL} "
|
lp_hostname_color=" with ${LP_COLOR_X11_ON}X${NO_COL}"
|
||||||
else
|
else
|
||||||
lp_hostname_color="with ${LP_COLOR_X11_OFF}CLI${NO_COL} "
|
lp_hostname_color=" with ${LP_COLOR_X11_OFF}CLI${NO_COL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _lp_chroot; then
|
if _lp_chroot; then
|
||||||
lp_hostname_color+="(within ${lp_chroot}) "
|
lp_hostname_color+="(within ${lp_chroot})"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _lp_hostname; then
|
if _lp_hostname; then
|
||||||
case "$lp_connection" in
|
case "$lp_connection" in
|
||||||
lcl)
|
lcl)
|
||||||
lp_hostname_color+="in ${LP_COLOR_HOST}${lp_hostname}${NO_COL}"
|
lp_hostname_color+=" in ${LP_COLOR_HOST}${lp_hostname}${NO_COL}"
|
||||||
;;
|
;;
|
||||||
ssh)
|
ssh)
|
||||||
# If we want a different color for each host
|
# If we want a different color for each host
|
||||||
(( LP_ENABLE_SSH_COLORS )) && LP_COLOR_SSH="$LP_COLOR_HOST_HASH"
|
(( LP_ENABLE_SSH_COLORS )) && LP_COLOR_SSH="$LP_COLOR_HOST_HASH"
|
||||||
lp_hostname_color+="in ${LP_COLOR_SSH}${lp_hostname}${NO_COL}"
|
lp_hostname_color+=" in ${LP_COLOR_SSH}${lp_hostname}${NO_COL}"
|
||||||
;;
|
;;
|
||||||
su)
|
su)
|
||||||
lp_hostname_color+="in ${LP_COLOR_SU}${lp_hostname}${NO_COL}"
|
lp_hostname_color+=" in ${LP_COLOR_SU}${lp_hostname}${NO_COL}"
|
||||||
;;
|
;;
|
||||||
tel)
|
tel)
|
||||||
lp_hostname_color+="IN ${LP_COLOR_TELNET}${lp_hostname}${NO_COL}"
|
lp_hostname_color+=" IN ${LP_COLOR_TELNET}${lp_hostname}${NO_COL}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
lp_hostname_color+="in ${NO_COL}${lp_hostname}" # defaults to no color
|
lp_hostname_color+=" in ${NO_COL}${lp_hostname}" # defaults to no color
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
||||||
19
pure.theme
19
pure.theme
|
|
@ -121,6 +121,7 @@ _lp_pure_theme_activate() {
|
||||||
|
|
||||||
LP_COLOR_PATH="$BLUE"
|
LP_COLOR_PATH="$BLUE"
|
||||||
LP_COLOR_PATH_SEPARATOR="$BLUE"
|
LP_COLOR_PATH_SEPARATOR="$BLUE"
|
||||||
|
LP_COLOR_PATH_SHORTENED="$BLUE"
|
||||||
LP_COLOR_PATH_VCS_ROOT="$BOLD"
|
LP_COLOR_PATH_VCS_ROOT="$BOLD"
|
||||||
LP_COLOR_PATH_LAST_DIR="$BOLD"
|
LP_COLOR_PATH_LAST_DIR="$BOLD"
|
||||||
LP_COLOR_PATH_ROOT="$BOLD_YELLOW"
|
LP_COLOR_PATH_ROOT="$BOLD_YELLOW"
|
||||||
|
|
@ -155,7 +156,7 @@ _lp_pure_theme_activate() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _lp_hostname_color ; then
|
if _lp_hostname_color ; then
|
||||||
LP_HOST="$lp_hostname_color "
|
LP_HOST="$lp_hostname_color"
|
||||||
else
|
else
|
||||||
LP_HOST=
|
LP_HOST=
|
||||||
fi
|
fi
|
||||||
|
|
@ -165,12 +166,12 @@ _lp_pure_theme_directory() {
|
||||||
local lp_path_format
|
local lp_path_format
|
||||||
_lp_path_format "$LP_COLOR_PATH" "$LP_COLOR_PATH_LAST_DIR" "$LP_COLOR_PATH_VCS_ROOT" "$LP_COLOR_PATH_SHORTENED" "/" "$LP_COLOR_PATH_SEPARATOR"
|
_lp_path_format "$LP_COLOR_PATH" "$LP_COLOR_PATH_LAST_DIR" "$LP_COLOR_PATH_VCS_ROOT" "$LP_COLOR_PATH_SHORTENED" "/" "$LP_COLOR_PATH_SEPARATOR"
|
||||||
|
|
||||||
LP_PWD="${lp_path_format}${NO_COL}"
|
LP_PWD=" ${lp_path_format}${NO_COL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_lp_pure_theme_prompt() {
|
_lp_pure_theme_prompt() {
|
||||||
if _lp_jobcount_color; then
|
if _lp_jobcount_color; then
|
||||||
LP_JOBS=" ${LP_PURE_COLOR_JOBS}${LP_PURE_MARK_JOBS}${NO_COL}"
|
LP_JOBS="${LP_PURE_COLOR_JOBS}${LP_PURE_MARK_JOBS}${NO_COL}"
|
||||||
else
|
else
|
||||||
LP_JOBS=
|
LP_JOBS=
|
||||||
fi
|
fi
|
||||||
|
|
@ -213,7 +214,8 @@ _lp_pure_theme_prompt_template() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${LP_PS1-}" ]]; then
|
if [[ -z "${LP_PS1-}" ]]; then
|
||||||
PS1="${LP_USER}${LP_HOST}${LP_PWD}${LP_VCS}${LP_RUNTIME}\n${LP_VENV}${LP_JOBS}"
|
local n=$'\n'
|
||||||
|
PS1="${LP_USER}${LP_HOST}${LP_PWD}${LP_VCS}${LP_RUNTIME}${n}${LP_VENV}${LP_JOBS}"
|
||||||
|
|
||||||
if [[ -n "${LP_ERR}" ]] ; then
|
if [[ -n "${LP_ERR}" ]] ; then
|
||||||
PS1+="${LP_COLOR_ERR}${LP_MARK} "
|
PS1+="${LP_COLOR_ERR}${LP_MARK} "
|
||||||
|
|
@ -222,7 +224,7 @@ _lp_pure_theme_prompt_template() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the core sections without prompt escapes and make them into a title.
|
# Get the core sections without prompt escapes and make them into a title.
|
||||||
_lp_formatted_title "${LP_USER}${LP_HOST}${lp_path-}${LP_MARK}"
|
# _lp_formatted_title "${LP_USER}${LP_HOST}${lp_path-}${LP_MARK}"
|
||||||
else
|
else
|
||||||
PS1=$LP_PS1
|
PS1=$LP_PS1
|
||||||
fi
|
fi
|
||||||
|
|
@ -252,7 +254,7 @@ _lp_pure_vcs() {
|
||||||
if _lp_vcs_commits_off_remote; then
|
if _lp_vcs_commits_off_remote; then
|
||||||
lp_vcs_details_color="$LP_COLOR_COMMITS_BEHIND"
|
lp_vcs_details_color="$LP_COLOR_COMMITS_BEHIND"
|
||||||
if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then
|
if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then
|
||||||
has_commit="${LP_COLOR_COMMITS}${LP_PURE_GIT_UP_ARROW}{NO_COL}${LP_COLOR_COMMITS_BEHIND}${LP_PURE_GIT_DOWN_ARROW}${NO_COL}"
|
has_commit="${LP_COLOR_COMMITS}${LP_PURE_GIT_UP_ARROW}${NO_COL}${LP_COLOR_COMMITS_BEHIND}${LP_PURE_GIT_DOWN_ARROW}${NO_COL}"
|
||||||
elif [[ "$lp_vcs_commit_ahead" -ne "0" ]]; then
|
elif [[ "$lp_vcs_commit_ahead" -ne "0" ]]; then
|
||||||
has_commit="${LP_COLOR_COMMITS}${LP_PURE_GIT_UP_ARROW}${NO_COL}"
|
has_commit="${LP_COLOR_COMMITS}${LP_PURE_GIT_UP_ARROW}${NO_COL}"
|
||||||
lp_vcs_details_color="$LP_COLOR_COMMITS"
|
lp_vcs_details_color="$LP_COLOR_COMMITS"
|
||||||
|
|
@ -283,18 +285,17 @@ _lp_pure_vcs() {
|
||||||
if [[ -n "$has_lines" ]]; then
|
if [[ -n "$has_lines" ]]; then
|
||||||
lp_vcs_details_color+="${LP_COLOR_DIFF}${has_lines}${NO_COL}${has_commit}"
|
lp_vcs_details_color+="${LP_COLOR_DIFF}${has_lines}${NO_COL}${has_commit}"
|
||||||
fi
|
fi
|
||||||
lp_vcs_details_color+="${has_commit}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _lp_vcs_head_status; then
|
if _lp_vcs_head_status; then
|
||||||
lp_vcs_details_color+=" $LP_COLOR_CHANGES$lp_vcs_head_status"
|
lp_vcs_details_color+=" ${LP_COLOR_CHANGES}${lp_vcs_head_status}"
|
||||||
if [[ -n "${lp_vcs_head_details-}" ]]; then
|
if [[ -n "${lp_vcs_head_details-}" ]]; then
|
||||||
lp_vcs_details_color+=" ${lp_vcs_head_details}"
|
lp_vcs_details_color+=" ${lp_vcs_head_details}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _lp_vcs_stash_count; then
|
if _lp_vcs_stash_count; then
|
||||||
lp_vcs_details_color+=" $LP_COLOR_COMMITS$LP_MARK_STASH"
|
lp_vcs_details_color+=" ${LP_COLOR_COMMITS}${LP_MARK_STASH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Pure does not show untracked files.
|
# Pure does not show untracked files.
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,8 @@ _lp_starship_theme_prompt_data() {
|
||||||
if _lp_sudo_active_color; then
|
if _lp_sudo_active_color; then
|
||||||
# LP_COLOR_MARK="$lp_sudo_active_color"
|
# LP_COLOR_MARK="$lp_sudo_active_color"
|
||||||
LP_STARSHIP_SUDO="${LP_COLOR_MARK_SUDO}${LP_STARSHIP_MARK_SUDO}${NO_COL} "
|
LP_STARSHIP_SUDO="${LP_COLOR_MARK_SUDO}${LP_STARSHIP_MARK_SUDO}${NO_COL} "
|
||||||
|
else
|
||||||
|
LP_STARSHIP_SUDO=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if _lp_dirstack_color; then
|
# if _lp_dirstack_color; then
|
||||||
|
|
@ -310,9 +312,9 @@ _lp_starship_theme_prompt_template() {
|
||||||
if [[ -z "${LP_PS1-}" ]]; then
|
if [[ -z "${LP_PS1-}" ]]; then
|
||||||
# Docker is displayed along with Singularity and Kubernetes (strange that it is not the case in Starship…),
|
# Docker is displayed along with Singularity and Kubernetes (strange that it is not the case in Starship…),
|
||||||
# in the container section, which is not duplicated at the end, like in Starship (WTF?).
|
# in the container section, which is not duplicated at the end, like in Starship (WTF?).
|
||||||
local n='\n'
|
local n=$'\n'
|
||||||
PS1="${LP_USER}${LP_HOST}${LP_SHLVL}${LP_CONTAINER}${LP_KUBECONTEXT}${LP_PWD}${LP_PERM} ${LP_VCS}${LP_CMAKE}${LP_NODE_VENV}${LP_VENV}${LP_TFSPACE}${LP_AWS_PROFILE}${LP_PS1_POSTFIX}${LP_STARSHIP_SUDO}${LP_RUNTIME}${n}"
|
PS1="${LP_USER}${LP_HOST}${LP_SHLVL}${LP_CONTAINER}${LP_KUBECONTEXT}${LP_PWD}${LP_PERM} ${LP_VCS}${LP_CMAKE}${LP_NODE_VENV}${LP_VENV}${LP_TFSPACE}${LP_AWS_PROFILE}${LP_PS1_POSTFIX}${LP_STARSHIP_SUDO}${LP_RUNTIME}${n}"
|
||||||
PS1+="${LP_JOBS}${LP_BATTERY}${LP_TIME}${LP_ERR}${LP_COLOR_MARK}${LP_MARK}"
|
PS1+="${LP_JOBS}${LP_BATT}${LP_TIME}${LP_ERR}${LP_COLOR_MARK}${LP_MARK}"
|
||||||
|
|
||||||
# No title support in Starship.
|
# No title support in Starship.
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue