Repository navigation
Revert "fix: solve #3028 — forward DA1 query responses during shell init" #3127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,21 +224,18 @@ export class Session { | |
| // Set initial CWD | ||
| this.emulator.setCwd(options.cwd); | ||
|
|
||
| // The headless emulator responds to terminal queries (e.g. DA1, | ||
| // DSR) when no renderer client is attached. These responses must | ||
| // be forwarded to the subprocess immediately — even during shell | ||
| // init — because shells like fish send DA1 at startup and wait | ||
| // up to 10 seconds for a reply before disabling optional features. | ||
| // Unlike renderer-generated responses (which go through write() | ||
| // and are correctly dropped during init to avoid appearing as | ||
| // typed text), headless emulator responses are written directly | ||
| // to the PTY and consumed by the shell as protocol data. | ||
| // The headless emulator responds to terminal queries (e.g. DA) | ||
| // when no renderer client is attached. During shell init we drop | ||
| // these — they'd land in the pre-ready stdin queue and appear as | ||
| // typed text like "?62;4;9;22c" once flushed. After a client | ||
| // attaches the renderer's xterm handles all terminal queries. | ||
| this.emulator.onData((data) => { | ||
| if ( | ||
| this.attachedClients.size === 0 && | ||
| this.subprocess && | ||
| this.subprocessReady | ||
| ) { | ||
| if (this.shellReadyState === "pending") return; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
By returning early when The The original PR #3030 was specifically introduced to fix this. If this revert is needed because #3030 introduced a separate regression, that regression should be documented here (and ideally addressed separately) so the trade-off is clear. |
||
| this.sendWriteToSubprocess(data); | ||
| } | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendWriteToSubprocessbypasses thepreReadyStdinQueueThe comment justifies dropping headless-emulator responses during
pendingby saying they'd "land in the pre-ready stdin queue and appear as typed text like?62;4;9;22conce flushed." This is factually incorrect.The
onDatacallback callsthis.sendWriteToSubprocess(data)directly, notthis.write(data). Onlywrite()routes throughpreReadyStdinQueue. The emulator's response would be sent straight to the subprocess's stdin — it would never touch the pre-ready queue. If the real motivation is something else (e.g. the headless emulator generates an incorrect or incomplete DA1 response that confuses fish/zsh), the comment should say so.