Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1749,13 +1749,19 @@ export class Terminal implements ITerminalCore {
*
* Without this, shells like nushell that rely on cursor position queries
* will hang waiting for a response that never comes.
*
* Note: We loop to read all pending responses, not just one. This is important
* when multiple queries are processed in a single write() call (e.g., when
* buffered data is written all at once during terminal initialization).
*/
private processTerminalResponses(): void {
if (!this.wasmTerm) return;

// Read any pending responses from the WASM terminal
const response = this.wasmTerm.readResponse();
if (response) {
// Read all pending responses from the WASM terminal
// Multiple responses can be queued if a single write() contained multiple queries
while (true) {
const response = this.wasmTerm.readResponse();
if (response === null) break;
// Send response back to the PTY via onData
// This is the same path as user keyboard input
this.dataEmitter.fire(response);
Expand Down