Fix freeze after closing terminal on windows

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-12-08 16:16:28 -05:00
1 parent 889a4d5080
commit f1cce7ccaa
2 files changed
+2 -8

No files matched your search

+2
View File
@@ -158,6 +158,8 @@ export abstract class ShellSession {
cwd,
env,
name: "xterm-256color",
// TODO: Something else is broken here so we need to force the use of winPty on windows
useConpty: false,
}));
}
-8
View File
@@ -144,14 +144,6 @@ export class TerminalApi extends WebSocketApi<TerminalEvents> {
this.socket.binaryType = "arraybuffer";
}
destroy() {
if (!this.socket) return;
const controlCode = String.fromCharCode(4); // ctrl+d
this.sendMessage({ type: TerminalChannels.STDIN, data: controlCode });
setTimeout(() => super.destroy(), 2000);
}
reconnect() {
super.reconnect();
}