enable iterm2 shell integration when running in tmux in zsh4humans

pull/1161/head
Roman Perepelitsa 4 years ago
parent ecf1de25a4
commit 96646e8b9c

@ -6025,7 +6025,7 @@ _p9k_dump_instant_prompt() {
local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0)) local -i fill=$((COLUMNS > _p9k__ret ? COLUMNS - _p9k__ret : 0))
out+="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}" out+="${(%):-%b%k%f%s%u$mark${(pl.$fill.. .)}$cr%b%k%f%s%u%E}"
fi fi
out+="${(pl.$height..$lf.)}$esc${height}A$terminfo[sc]" (( _z4h_can_save_restore_screen == 1 )) || out+="${(pl.$height..$lf.)}$esc${height}A$terminfo[sc]"
out+=${(%):-"$__p9k_used_instant_prompt[1]$__p9k_used_instant_prompt[2]"} out+=${(%):-"$__p9k_used_instant_prompt[1]$__p9k_used_instant_prompt[2]"}
if [[ -n $__p9k_used_instant_prompt[3] ]]; then if [[ -n $__p9k_used_instant_prompt[3] ]]; then
_p9k_prompt_length "$__p9k_used_instant_prompt[2]" _p9k_prompt_length "$__p9k_used_instant_prompt[2]"
@ -6036,6 +6036,7 @@ _p9k_dump_instant_prompt() {
out+="${(pl.$gap.. .)}${(%):-${__p9k_used_instant_prompt[3]}%b%k%f%s%u}$cr$esc${left_len}C" out+="${(pl.$gap.. .)}${(%):-${__p9k_used_instant_prompt[3]}%b%k%f%s%u}$cr$esc${left_len}C"
fi fi
fi fi
(( _z4h_can_save_restore_screen == 1 )) && out+="$cr$esc${height}A$terminfo[sc]$out"
typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$ typeset -g __p9k_instant_prompt_output=${TMPDIR:-/tmp}/p10k-instant-prompt-output-${(%):-%n}-$$
{ echo -n > $__p9k_instant_prompt_output } || return { echo -n > $__p9k_instant_prompt_output } || return
print -rn -- "$out" || return print -rn -- "$out" || return
@ -7839,8 +7840,13 @@ _p9k_init_prompt() {
fi fi
if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then
_p9k_prompt_prefix_left+=$'%{\e]133;A\a%}' if (( _z4h_can_save_restore_screen == 1 )); then
_p9k_prompt_suffix_left+=$'%{\e]133;B\a%}' _p9k_prompt_prefix_left+=$'%{\ePtmux;\e\e]133;A\a\e\\\\%}'
_p9k_prompt_suffix_left+=$'%{\ePtmux;\e\e]133;B\a\e\\\\%}'
else
_p9k_prompt_prefix_left+=$'%{\e]133;A\a\e%}'
_p9k_prompt_suffix_left+=$'%{\e]133;B\a\e%}'
fi
fi fi
if (( _POWERLEVEL9K_PROMPT_ADD_NEWLINE_COUNT > 0 )); then if (( _POWERLEVEL9K_PROMPT_ADD_NEWLINE_COUNT > 0 )); then
@ -7931,7 +7937,7 @@ _p9k_must_init() {
[[ $sig == $_p9k__param_sig ]] && return 1 [[ $sig == $_p9k__param_sig ]] && return 1
_p9k_deinit _p9k_deinit
fi fi
_p9k__param_pat=$'v109\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1' _p9k__param_pat=$'v110\1'${(q)ZSH_VERSION}$'\1'${(q)ZSH_PATCHLEVEL}$'\1'
_p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1'
_p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1'
_p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1' _p9k__param_pat+=$'$GITSTATUS_CACHE_DIR\1$GITSTATUS_AUTO_INSTALL\1${ZLE_RPROMPT_INDENT:-1}\1'
@ -8004,9 +8010,13 @@ function _p9k_init_cacheable() {
_p9k_transient_prompt+='${:-"'$_p9k__ret'"}' _p9k_transient_prompt+='${:-"'$_p9k__ret'"}'
_p9k_transient_prompt+=')%b%k%f%s%u ' _p9k_transient_prompt+=')%b%k%f%s%u '
if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then
if (( _z4h_can_save_restore_screen == 1 )); then
_p9k_transient_prompt=$'%{\ePtmux;\e\e]133;A\a\e\\\\%}'$_p9k_transient_prompt$'%{\ePtmux;\e\e]133;B\a\e\\\\%}'
else
_p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}' _p9k_transient_prompt=$'%{\e]133;A\a%}'$_p9k_transient_prompt$'%{\e]133;B\a%}'
fi fi
fi fi
fi
_p9k_uname="$(uname)" _p9k_uname="$(uname)"
[[ $_p9k_uname == Linux ]] && _p9k_uname_o="$(uname -o 2>/dev/null)" [[ $_p9k_uname == Linux ]] && _p9k_uname_o="$(uname -o 2>/dev/null)"

Loading…
Cancel
Save