Skip to content

Commit 431e53f

Browse files
fix(server): terminal history drops the ESC Z identity query (pingdotgg#36024)
1 parent c29c26a commit 431e53f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/server/src/terminal/Manager.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ it.layer(
13991399

14001400
process.emitData("prompt ");
14011401
process.emitData("\u001b[?2026$p\u001b[?2026;2$y\u001b[>q\u001b[?u\u001b[?31u");
1402-
process.emitData("\u001b[=c\u001b[=0c");
1402+
process.emitData("\u001b[=c\u001b[=0c\u001bZ");
14031403
process.emitData("\u001bP$q m\u001b\\\u001bP1$r0m\u001b\\");
14041404
process.emitData("\u001bP+q544e\u001b\\\u001bP1+r544e=1b\u001b\\");
14051405
// BEL is DCS payload, not a terminator: only ST ends the string.

‎apps/server/src/terminal/Manager.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,10 @@ function sanitizeTerminalHistoryChunk(
13231323
if (escapeSequenceEndIndex === null) {
13241324
return { visibleText, pendingControlSequence: input.slice(index) };
13251325
}
1326-
append(input.slice(index, escapeSequenceEndIndex));
1326+
// ESC Z (DECID) is the legacy primary device attributes query.
1327+
if (nextCodePoint !== 0x5a) {
1328+
append(input.slice(index, escapeSequenceEndIndex));
1329+
}
13271330
index = escapeSequenceEndIndex;
13281331
continue;
13291332
}

0 commit comments

Comments
 (0)