Skip to content

feat: support attaching inspectors and osc decoder#6

Merged
pi0 merged 4 commits into
mainfrom
feat/inspectors
May 27, 2026
Merged

feat: support attaching inspectors and osc decoder#6
pi0 merged 4 commits into
mainfrom
feat/inspectors

Conversation

@pi0x
Copy link
Copy Markdown
Contributor

@pi0x pi0x commented May 27, 2026

No description provided.

@pi0x pi0x force-pushed the feat/inspectors branch from 649c4cd to 8bd0167 Compare May 27, 2026 09:00
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>
@pi0 pi0 changed the title feat: osc inspector feat: support attaching inspectors and osc decoder May 27, 2026
@pi0 pi0 marked this pull request as ready for review May 27, 2026 09:38
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>
@pi0 pi0 merged commit 07086ae into main May 27, 2026
3 checks passed
@pi0 pi0 deleted the feat/inspectors branch May 27, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants