fix(terminal): suppress DA response feedback loop after closing vim
Client-side xterm.js was generating Device Attributes responses via onData, which fed back to the PTY as visible text. Register CSI handlers to consume query responses on the client and respond to DA1 on the server.
This commit is contained in:
@@ -272,6 +272,15 @@ export async function createTerminal(options: CreateTerminalOptions): Promise<Te
|
||||
},
|
||||
});
|
||||
|
||||
// Respond to DA1 queries (CSI c or CSI 0 c) — apps like nvim query terminal capabilities
|
||||
terminal.parser.registerCsiHandler({ final: "c" }, (params) => {
|
||||
if (params.length === 0 || (params.length === 1 && params[0] === 0)) {
|
||||
ptyProcess.write("\x1b[?62;4;22c");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
function emitExit(): void {
|
||||
if (exitEmitted) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user