File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1749,13 +1749,19 @@ export class Terminal implements ITerminalCore {
17491749 *
17501750 * Without this, shells like nushell that rely on cursor position queries
17511751 * will hang waiting for a response that never comes.
1752+ *
1753+ * Note: We loop to read all pending responses, not just one. This is important
1754+ * when multiple queries are processed in a single write() call (e.g., when
1755+ * buffered data is written all at once during terminal initialization).
17521756 */
17531757 private processTerminalResponses ( ) : void {
17541758 if ( ! this . wasmTerm ) return ;
17551759
1756- // Read any pending responses from the WASM terminal
1757- const response = this . wasmTerm . readResponse ( ) ;
1758- if ( response ) {
1760+ // Read all pending responses from the WASM terminal
1761+ // Multiple responses can be queued if a single write() contained multiple queries
1762+ while ( true ) {
1763+ const response = this . wasmTerm . readResponse ( ) ;
1764+ if ( response === null ) break ;
17591765 // Send response back to the PTY via onData
17601766 // This is the same path as user keyboard input
17611767 this . dataEmitter . fire ( response ) ;
You can’t perform that action at this time.
0 commit comments