From 2c3bcd8b5d301f469fd8095d32ab2dc18e254a8e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Sat, 28 Nov 2020 09:55:13 +0100 Subject: [PATCH] use tmux bypass in iterm2 integration only if _z4h_iterm_cmd is defined --- internal/p10k.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index e55f1d21..6304bc1c 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7840,7 +7840,7 @@ _p9k_init_prompt() { fi if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then - if (( _z4h_can_save_restore_screen == 1 )); then + if (( $+_z4h_iterm_cmd && _z4h_can_save_restore_screen == 1 )); then _p9k_prompt_prefix_left+=$'%{\ePtmux;\e\e]133;A\a\e\\%}' _p9k_prompt_suffix_left+=$'%{\ePtmux;\e\e]133;B\a\e\\%}' else @@ -7946,7 +7946,8 @@ _p9k_must_init() { _p9k__param_pat+=$'${(M)VTE_VERSION:#(<1-4602>|4801)}\1$DEFAULT_USER\1$P9K_SSH\1$+commands[uname]\1' _p9k__param_pat+=$'$__p9k_root_dir\1$functions[p10k-on-init]\1$functions[p10k-on-pre-prompt]\1' _p9k__param_pat+=$'$functions[p10k-on-post-widget]\1$functions[p10k-on-post-prompt]\1' - _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]' + _p9k__param_pat+=$'$+commands[git]\1$terminfo[colors]\1${+_z4h_iterm_cmd}\1' + _p9k__param_pat+=$'$_z4h_can_save_restore_screen' local MATCH IFS=$'\1' _p9k__param_pat+="${(@)${(@o)parameters[(I)POWERLEVEL9K_*]}:/(#m)*/\${${(q)MATCH}-$IFS\}}" IFS=$'\2' _p9k__param_sig="${(e)_p9k__param_pat}" @@ -8010,7 +8011,7 @@ function _p9k_init_cacheable() { _p9k_transient_prompt+='${:-"'$_p9k__ret'"}' _p9k_transient_prompt+=')%b%k%f%s%u ' if [[ $ITERM_SHELL_INTEGRATION_INSTALLED == Yes ]]; then - if (( _z4h_can_save_restore_screen == 1 )); then + if (( $+_z4h_iterm_cmd && _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%}'