Skip to content

Commit a9f5cbd

Browse files
authored
Improve Lite Terminal shell integration (#1505)
1 parent aa4a038 commit a9f5cbd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/webSocketTerminal.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
220220
this._closeEmitter.fire();
221221
return;
222222
}
223+
// Set terminal properties
224+
this._hideCursorWrite("\x1b]633;P;IsWindows=False\x07");
223225
// Print the opening message
224226
this._hideCursorWrite(
225227
`\x1b[32mConnected to \x1b[0m\x1b[4m${this._api.config.host}:${this._api.config.port}${this._api.config.pathPrefix}\x1b[0m\x1b[32m as \x1b[0m\x1b[3m${this._api.config.username}\x1b[0m\r\n\r\n`
@@ -364,7 +366,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
364366
// Send the input to the server for processing
365367
this._socket.send(JSON.stringify({ type: this._state, input: this._input }));
366368
if (this._state == "prompt") {
367-
this._hideCursorWrite(`\x1b]633;C\x07\x1b]633;E;${this._inputEscaped()}\x07\r\n`);
369+
this._hideCursorWrite(`\x1b]633;E;${this._inputEscaped()}\x07\x1b]633;C\x07\r\n`);
368370
if (this._input == "") {
369371
this._promptExitCode = "";
370372
}
@@ -676,7 +678,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
676678
// Send the input to the server for processing
677679
this._socket.send(JSON.stringify({ type: this._state, input: this._input }));
678680
if (this._state == "prompt") {
679-
this._hideCursorWrite(`\x1b]633;C\x07\x1b]633;E;${this._inputEscaped()}\x07\r\n`);
681+
this._hideCursorWrite(`\x1b]633;E;${this._inputEscaped()}\x07\x1b]633;C\x07\r\n`);
680682
if (this._input == "") {
681683
this._promptExitCode = "";
682684
}

0 commit comments

Comments
 (0)