Compare commits

...

8 Commits

Author SHA1 Message Date
Faddeev-Popov 452d7b72a2
Merge 8cc3298bac into a0c9dbe80b 2026-06-06 11:49:15 -04:00
Roman Perepelitsa a0c9dbe80b bump version 2026-06-02 20:20:51 +02:00
George Nachman 31982e202d
emit OSC 133 k=r and k=s for iTerm2 >= 3.7.0 (#2954)
iTerm2 3.7.0 added receiver support for the OSC 133 k= attribute
(Semantic Prompt prompt kinds: k=i initial, k=s secondary/PS2,
k=c continuation, k=r right). When emitted by the shell, iTerm2
records the bracketed cells as non-input on the active primary
prompt mark, so consumers (Select Current Command, share-as-URL,
AI prompt extraction, the Python GetPromptResponse.excluded_subranges
field) can subtract them from the typed-command range.

Two gaps for iTerm2 today:

1. The RPROMPT k=r wrap in _p9k_init_prompt is gated to WarpTerminal.
   iTerm2 sessions never trip the gate, so right-prompt cells leak
   into "Select Current Command", share URLs, etc.

2. p10k replaces iTerm2's iterm2_decorate_prompt with a stub that
   only records ITERM2_PRECMD_PS1. iTerm2's original function also
   wraps PS2 with OSC 133; the stub drops that wrap entirely, so
   multi-line input (for, while, unclosed quotes, heredocs, backslash
   continuations) produces no k=s markers and iTerm2 has no way to
   tell PS2-prefix cells apart from user input.

Both fixes are gated on iTerm2 >= 3.7.0 via
TERM_PROGRAM_VERSION == (3.<7->*|<4->.*). Older iTerm2 receivers do
not parse k= and would treat k=r/k=s markers as spurious primary
prompts (extra navigation marks, broken command-range tracking,
broken paste-each-line semantics). WarpTerminal behavior is
unchanged. The ITERM2_SQUELCH_PS2_MARK opt-out from iTerm2's
original iterm2_decorate_prompt is preserved.
2026-06-02 20:16:25 +02:00
Faddeev-Popov 8cc3298bac update readme with vifm information 2025-06-11 04:18:35 -04:00
Faddeev-Popov 29fe575b3c add themes support for vifm 2025-06-11 04:18:29 -04:00
Faddeev-Popov ff6f434aa9 add visual expansion to wizard for vifm 2025-06-11 04:18:24 -04:00
Faddeev-Popov 9b3fc772e4 add prompt segment for vifm levels 2025-06-11 04:18:21 -04:00
Faddeev-Popov f049be947c add icon for vifm level 2025-06-11 04:17:43 -04:00
8 changed files with 61 additions and 3 deletions

View File

@ -364,6 +364,7 @@ You can enable as many segments as you like. It won't slow down your prompt or Z
| `ram` | free RAM |
| `ranger` | [ranger](https://github.com/ranger/ranger) shell |
| `yazi` | [yazi](https://github.com/sxyazi/yazi) shell |
| `vifm` | [vifm](https://github.com/vifm/vifm) shell |
| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) |
| `rust_version` | [rustc](https://www.rust-lang.org) version |
| `rvm` | ruby environment from [rvm](https://rvm.io) |

View File

@ -82,6 +82,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
yazi # yazi shell (https://github.com/sxyazi/yazi)
vifm # vifm shell (https://github.com/vifm/vifm)
nnn # nnn shell (https://github.com/jarun/nnn)
lf # lf shell (https://github.com/gokcehan/lf)
xplr # xplr shell (https://github.com/sayanarijit/xplr)
@ -737,6 +738,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]#####################
# Vifm shell color.
typeset -g POWERLEVEL9K_VIFM_FOREGROUND=178
# Custom icon.
# typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
typeset -g POWERLEVEL9K_NNN_FOREGROUND=72

View File

@ -82,6 +82,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
yazi # yazi shell (https://github.com/sxyazi/yazi)
vifm # vifm shell (https://github.com/vifm/vifm)
nnn # nnn shell (https://github.com/jarun/nnn)
lf # lf shell (https://github.com/gokcehan/lf)
xplr # xplr shell (https://github.com/sayanarijit/xplr)
@ -728,6 +729,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]#####################
# Vifm shell color.
typeset -g POWERLEVEL9K_VIFM_FOREGROUND=3
# Custom icon.
# typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
typeset -g POWERLEVEL9K_NNN_FOREGROUND=3

View File

@ -82,6 +82,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
yazi # yazi shell (https://github.com/sxyazi/yazi)
vifm # vifm shell (https://github.com/vifm/vifm)
nnn # nnn shell (https://github.com/jarun/nnn)
lf # lf shell (https://github.com/gokcehan/lf)
xplr # xplr shell (https://github.com/sayanarijit/xplr)
@ -728,6 +729,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]#####################
# Vifm shell color.
typeset -g POWERLEVEL9K_VIFM_FOREGROUND=178
# Custom icon.
# typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
typeset -g POWERLEVEL9K_NNN_FOREGROUND=72

View File

@ -82,6 +82,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
yazi # yazi shell (https://github.com/sxyazi/yazi)
vifm # vifm shell (https://github.com/vifm/vifm)
nnn # nnn shell (https://github.com/jarun/nnn)
lf # lf shell (https://github.com/gokcehan/lf)
xplr # xplr shell (https://github.com/sayanarijit/xplr)
@ -757,6 +758,13 @@
# Custom icon.
# typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐'
####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]#####################
# Vifm shell color.
typeset -g POWERLEVEL9K_VIFM_FOREGROUND=3
typeset -g POWERLEVEL9K_VIFM_BACKGROUND=0
# Custom icon.
# typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐'
######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
# Nnn shell color.
typeset -g POWERLEVEL9K_NNN_FOREGROUND=0

View File

@ -141,6 +141,7 @@ function _p9k_init_icons() {
LARAVEL_ICON ''
RANGER_ICON '\u2B50' # ⭐
YAZI_ICON '\u2B50' # ⭐
VIFM_ICON '\u2B50' # ⭐
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON 'vim'
TERRAFORM_ICON 'tf'
@ -296,6 +297,7 @@ function _p9k_init_icons() {
LARAVEL_ICON ''
RANGER_ICON '\u2B50' # ⭐
YAZI_ICON '\u2B50' # ⭐
VIFM_ICON '\u2B50' # ⭐
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON 'vim'
TERRAFORM_ICON 'tf'
@ -454,6 +456,7 @@ function _p9k_init_icons() {
LARAVEL_ICON ''
RANGER_ICON '\u2B50' # ⭐
YAZI_ICON '\u2B50' # ⭐
VIFM_ICON '\u2B50' # ⭐
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON 'vim'
TERRAFORM_ICON 'tf'
@ -615,6 +618,7 @@ function _p9k_init_icons() {
LARAVEL_ICON '\ue73f'$q # 
RANGER_ICON '\uF00b ' # 
YAZI_ICON '\uF00b ' # 
VIFM_ICON '\uF00b ' # 
MIDNIGHT_COMMANDER_ICON 'mc' # mc
VIM_ICON '\uE62B' # 
TERRAFORM_ICON '\uF1BB ' # 
@ -771,6 +775,7 @@ function _p9k_init_icons() {
LARAVEL_ICON '\ue73f'$q # 
RANGER_ICON '\uF00b ' # 
YAZI_ICON '\uF00b ' # 
VIFM_ICON 'vifm' # vifm
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON '\uE62B' # 
TERRAFORM_ICON '\uF1BB ' # 
@ -924,6 +929,7 @@ function _p9k_init_icons() {
LARAVEL_ICON ''
RANGER_ICON 'ranger'
YAZI_ICON 'yazi'
VIFM_ICON 'vifm'
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON 'vim'
TERRAFORM_ICON 'tf'
@ -1079,6 +1085,7 @@ function _p9k_init_icons() {
LARAVEL_ICON ''
RANGER_ICON '\u2B50' # ⭐
YAZI_ICON '\u2B50' # ⭐
VIFM_ICON '\u2B50' # ⭐
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON 'vim'
TERRAFORM_ICON 'tf'

View File

@ -4975,6 +4975,18 @@ function instant_prompt_yazi() {
_p9k_prompt_segment prompt_yazi $_p9k_color1 yellow YAZI_ICON 1 '$YAZI_LEVEL' '$YAZI_LEVEL'
}
function prompt_vifm() {
_p9k_prompt_segment $0 $_p9k_color1 yellow VIFM_ICON 0 '' $VIFM_LEVEL
}
_p9k_prompt_vifm_init() {
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$VIFM_LEVEL'
}
function instant_prompt_vifm() {
_p9k_prompt_segment prompt_vifm $_p9k_color1 yellow VIFM_ICON 1 '$VIFM_LEVEL' '$VIFM_LEVEL'
}
function prompt_midnight_commander() {
local -i len=$#_p9k__prompt _p9k__has_upglob
_p9k_prompt_segment $0 $_p9k_color1 yellow MIDNIGHT_COMMANDER_ICON 0 '' ''
@ -8399,14 +8411,16 @@ _p9k_init_prompt() {
if (( _POWERLEVEL9K_TERM_SHELL_INTEGRATION )); then
_p9k_prompt_prefix_left+=$'%{\e]133;A\a%}'
_p9k_prompt_suffix_left+=$'%{\e]133;B\a%}'
if [[ $TERM_PROGRAM == WarpTerminal ]]; then
if [[ $TERM_PROGRAM == WarpTerminal ||
( $TERM_PROGRAM == iTerm.app && $TERM_PROGRAM_VERSION == (3.<7->*|<4->.*) ) ]]; then
_p9k_prompt_prefix_right=$'%{\e]133;P;k=r\a%}'$_p9k_prompt_prefix_right
_p9k_prompt_suffix_right+=$'%{\e]133;B\a%}'
fi
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\\%}'
if [[ $TERM_PROGRAM == WarpTerminal ]]; then
if [[ $TERM_PROGRAM == WarpTerminal ||
( $TERM_PROGRAM == iTerm.app && $TERM_PROGRAM_VERSION == (3.<7->*|<4->.*) ) ]]; then
_p9k_prompt_prefix_right=$'%{\ePtmux;\e\e]133;P;k=r\a\e\\%}'$_p9k_prompt_prefix_right
_p9k_prompt_suffix_right+=$'%{\ePtmux;\e\e]133;B\a\e\\%}'
fi
@ -8965,6 +8979,11 @@ _p9k_init() {
function iterm2_decorate_prompt() {
typeset -g ITERM2_PRECMD_PS1=$PROMPT
typeset -g ITERM2_SHOULD_DECORATE_PROMPT=
if [[ -n $PS2 && $PS2 != *$'\e]133;A;k=s\a'* && -z ${ITERM2_SQUELCH_PS2_MARK-} &&
$TERM_PROGRAM_VERSION == (3.<7->*|<4->.*) ]]; then
typeset -g ITERM2_PRECMD_PS2=$PS2
PS2=$'%{\e]133;A;k=s\a%}'$PS2$'%{\e]133;B\a%}'
fi
}
fi
if (( $+functions[iterm2_precmd] )); then
@ -9512,7 +9531,7 @@ if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file && -n $__p9k_instant_p
zf_rm -f -- $__p9k_instant_prompt_dump_file{,.zwc} 2>/dev/null
fi
typeset -g P9K_VERSION=1.20.15
typeset -g P9K_VERSION=1.20.16
if [[ ${VSCODE_SHELL_INTEGRATION-} == <1-> && ${+__p9k_force_term_shell_integration} == 0 ]]; then
typeset -gri __p9k_force_term_shell_integration=1

View File

@ -1750,6 +1750,8 @@ function generate_config() {
sub RANGER_VISUAL_IDENTIFIER_EXPANSION "'▲'"
uncomment 'typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION'
sub YAZI_VISUAL_IDENTIFIER_EXPANSION "'▲'"
uncomment 'typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION'
sub VIFM_VISUAL_IDENTIFIER_EXPANSION "'▲'"
uncomment 'typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION'
sub KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION "'○'"
uncomment 'typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION'