perf(shell-integration): emit prompt marks in one write via kitty-shell-cwd://#19
Merged
Merged
Conversation
…ll-cwd:// The zsh precmd hook percent-encoded $PWD one character at a time, forking $(printf) for every non-ASCII character (~60µs/prompt on an ASCII path, ~3.7ms in a non-ASCII path), and each hook issued four separate printf writes. The fish hook forked (hostname) on every prompt. Switch OSC 7 to the kitty-shell-cwd:// scheme (raw path, no encoding — the parser already supports it per REQ-OSC-3) and emit D/7/A/B as a single builtin printf in zsh/bash/fish: ~7µs/prompt regardless of path content. Also stop leaking noa-only bookkeeping into the session environment: ZDOTDIR is now unset after startup when the user never had one (Ghostty parity; previously ZDOTDIR=$HOME stayed exported), and USER_ZDOTDIR is a plain unexported variable.
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.
Summary
cmd.overhead(zsh) が ghostty 比 +25% だった真因の修正。zsh の precmd フックが $PWD を1文字ずつ percent-encode(非ASCII文字ごとに$(printf)を fork)し、プロンプト毎に printf を4回発行していた。fish はプロンプト毎に(hostname)を fork していた。kitty-shell-cwd://(raw path・エンコード不要、パーサは REQ-OSC-3 で対応済み)に変更ZDOTDIR=$HOMEが export されたまま残り、セッション内の子シェル計測を汚染)。USER_ZDOTDIRも非 export 化Test plan
cargo test -p noa-pty35/35 pass(zsh/bash 実 pty の OSC 133/7 E2E 含む・新スキームに追随)cargo clippy --workspaceクリーン