refactor: extract spawn abort handling into shared utility

This commit is contained in:
weishu
2025-12-26 18:18:12 +08:00
parent b3499bb5ed
commit 5d79a3f1ef
4 changed files with 159 additions and 184 deletions
+2
View File
@@ -2,6 +2,8 @@ export function restoreTerminalState(): void {
if (process.stdout.isTTY) {
// Disable kitty keyboard protocol / CSI u key release reporting if enabled.
process.stdout.write('\x1b[>4;0m');
// Disable focus reporting to avoid stray ^[[I on mode switches.
process.stdout.write('\x1b[?1004l');
process.stdout.write('\x1b[?2004l');
}
if (process.stdin.isTTY) {