feat: support attaching inspectors and osc decoder#6
Merged
Conversation
Audited decoders against xterm ctlseqs, ConEmu/Windows Terminal docs,
iTerm2 docs, kitty desktop-notifications spec, VSCode source, and
urxvtperl(3). Several existing branches were either misclassifying real
sequences or decoding formats no terminal actually emits.
Corrections (removed/fixed fictional or wrong behavior):
- OSC 9;9 is the ConEmu/Windows-Terminal CWD report, not a notification.
Now emitted as `{ kind: "cwd", source: "conemu" }`.
- OSC 9 fallthrough no longer misclassifies known ConEmu sub-commands
(1,2,3,5,6,7,8,10,11) as iTerm notifications.
- OSC 1337 `notify;...` is not a real iTerm2 form (iTerm2 uses OSC 9 for
Growl-style notifications). Removed.
- OSC 777 `urgency;push|pop` does not exist in urxvt or any shipped Perl
extension. Removed.
- OSC 99 completion is signaled by `d=1`, not by `p=done`. Replaced the
bogus `done: true` field with `partial: true` for `d=0` chunks.
New/expanded coverage:
- OSC 7: percent-decode path; surface scheme, host, and local flag;
accept any URI scheme (e.g. kitty-shell-cwd://).
- OSC 8: distinguish open vs close via `action` field.
- OSC 9;12: ConEmu prompt-start mark.
- OSC 52: surface `selections[]`, detect `clear` (Pd is neither base64
nor `?`), document `q` selection.
- OSC 99: surface id, urgency, partial, phase (close/alive/icon/...);
base64-decode payload when `e=1`.
- OSC 133: parse `D` exit code and `err=`; capture `A`/`C` kitty
extensions (redraw, special_key, cmdline...) in `params`.
- OSC 633: parse `P` key/value, `E` commandLine/nonce, `EnvSingleStart`,
`EnvSingleEntry`, `EnvSingleEnd`; apply VSCode `\\` + `\xNN` unescaping.
- OSC 1337: add `CurrentDir=`, `SetMark`, `RemoteHost=`, `SetUserVar=`,
`Copy=`, `ShellIntegrationVersion=`. RequestAttention now recognizes
the `once` effect alongside `fireworks`.
- OSC 0/1/2: strip C0 control bytes from titles (matches xterm/VTE).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reflect the audit fixes: OSC 9;9 now decodes as cwd (not notification), OSC 99 no longer shows the bogus `done: true` field, OSC 777 only documents notify (urgency was removed), and OSC 1337 lists all the new kinds (cwd / mark / userVar / remoteHost / clipboard / shellIntegrationVersion). Example switch covers the new shapes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.