powerlevel10k/internal
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
..
configure.zsh remove MULTIBYTE requirement from the configuration wizard (#2397) 2023-07-29 17:01:40 +02:00
icons.zsh minor cleanup (#2758) 2024-09-17 14:10:20 +02:00
notes.md notes 2020-06-15 17:56:32 +02:00
p10k.zsh emit OSC 133 k=r and k=s for iTerm2 >= 3.7.0 (#2954) 2026-06-02 20:16:25 +02:00
parser.zsh fix(parser.zsh): _p9k_parse_buffer docstring typo (#2820) 2025-01-29 05:28:19 -08:00
wizard.zsh Add AlmaLinux icon 2024-09-17 00:47:40 -04:00
worker.zsh survive broken $TMPDIR 2022-01-26 15:03:22 +01:00