Compare commits

...

4 Commits

Author SHA1 Message Date
Leon Alvarez aedef69275
Merge 4364c78d11 into 31982e202d 2026-06-02 14:16:56 -04: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
Leon Alvarez 4364c78d11
fix(icons.zsh): update Linux distros and Terraform icon mappings
Checked the cheat sheet, search for the logos on Internet and tried them on the console with an echo
2025-08-12 21:34:12 -03:00
Leon Alvarez cac5839316
fix(icons.zsh): update URLs and correct icon mappings
uFD03 was removed from nerdfont
Use \uEBD8 (The new Azure logo) for AZURE_ICON
Use \uEBE8 (Azure DevOps) for VCS_GIT_AZURE_ICON
Use \UF023 (Lock) for VPN_ICON
Add \uE7DD Flutter icon
Fix the comment with the URL to open nerdfonts.com cheat-sheet
2025-08-12 21:14:30 -03:00
2 changed files with 21 additions and 14 deletions

View File

@ -650,7 +650,7 @@ function _p9k_init_icons() {
'nerdfont-complete'|'nerdfont-fontconfig')
# nerd-font patched (complete) font required! See
# https://github.com/ryanoasis/nerd-fonts
# http://nerdfonts.com/#cheat-sheet
# http://nerdfonts.com/cheat-sheet
icons=(
RULER_CHAR '\u2500' # ─
LEFT_SEGMENT_SEPARATOR '\uE0B0' # 
@ -699,15 +699,15 @@ function _p9k_init_icons() {
LINUX_OPENSUSE_ICON '\uF314'$s # 
LINUX_SABAYON_ICON '\uF317'$s # 
LINUX_SLACKWARE_ICON '\uF319'$s # 
LINUX_VOID_ICON '\uF17C' # 
LINUX_ARTIX_ICON '\uF17C' # 
LINUX_VOID_ICON '\uF32E' # 
LINUX_ARTIX_ICON '\uF31F' # 
LINUX_UBUNTU_ICON '\uF31b'$s # 
LINUX_KALI_ICON '\uF17C' # 
LINUX_KALI_ICON '\uF327' # 
LINUX_RHEL_ICON '\uF316'$s # 
LINUX_AMZN_ICON '\uF270'$s # 
LINUX_ENDEAVOUROS_ICON '\uF17C' # 
LINUX_ROCKY_ICON '\uF17C' # 
LINUX_ALMALINUX_ICON '\uF17C' # 
LINUX_ENDEAVOUROS_ICON '\uF322' # 
LINUX_ROCKY_ICON '\uF32B' # 
LINUX_ALMALINUX_ICON '\uF31D' # 
LINUX_GUIX_ICON '\uF325'$s # 
LINUX_NEON_ICON '\uF17C' # 
LINUX_ICON '\uF17C' # 
@ -737,7 +737,7 @@ function _p9k_init_icons() {
VCS_GIT_GITHUB_ICON '\uF113 ' # 
VCS_GIT_BITBUCKET_ICON '\uE703 ' # 
VCS_GIT_GITLAB_ICON '\uF296 ' # 
VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ
VCS_GIT_AZURE_ICON '\uEBE8 ' # 
VCS_GIT_ARCHLINUX_ICON '\uF303 ' # 
VCS_GIT_CODEBERG_ICON '\uF1D3 ' # 
VCS_GIT_DEBIAN_ICON '\uF306 ' # 
@ -762,7 +762,7 @@ function _p9k_init_icons() {
NORDVPN_ICON '\UF023' # 
EXECUTION_TIME_ICON '\uF252'$s # 
SSH_ICON '\uF489'$s # 
VPN_ICON '\UF023'
VPN_ICON '\UF023' # 
KUBERNETES_ICON '\U2388' # ⎈
DROPBOX_ICON '\UF16B'$s # 
DATE_ICON '\uF073 ' # 
@ -773,13 +773,13 @@ function _p9k_init_icons() {
YAZI_ICON '\uF00b ' # 
MIDNIGHT_COMMANDER_ICON 'mc'
VIM_ICON '\uE62B' # 
TERRAFORM_ICON '\uF1BB ' # 
TERRAFORM_ICON '\uE8BD ' # 
PROXY_ICON '\u2194' # ↔
DOTNET_ICON '\uE77F' # 
DOTNET_CORE_ICON '\uE77F' # 
AZURE_ICON '\uFD03' # ﴃ
AZURE_ICON '\uEBD8' # 
DIRENV_ICON '\u25BC' # ▼
FLUTTER_ICON 'F'
FLUTTER_ICON '\uE7DD' # 
GCLOUD_ICON '\uF7B7' # 
LUA_ICON '\uE620' # 
PERL_ICON '\uE769' # 

View File

@ -8399,14 +8399,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 +8967,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