Skip to content

Commit 66f0f37

Browse files
authored
Support home and end keys in WebSocket Terminal (#1283)
1 parent e99f9de commit 66f0f37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/commands/webSocketTerminal.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const keys = {
1818
ctrlE: "\x05",
1919
ctrlH: "\x08",
2020
del: "\x1b[3~",
21+
home: "\x1b\x5b\x48",
22+
end: "\x1b\x5b\x46",
2123
};
2224

2325
const actions = {
@@ -484,6 +486,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
484486
this._state = "eval";
485487
return;
486488
}
489+
case keys.home:
487490
case keys.ctrlA: {
488491
if (this._state == "prompt" && this._cursorCol - this._margin > 0) {
489492
// Move the cursor to the beginning of the line
@@ -492,6 +495,7 @@ class WebSocketTerminal implements vscode.Pseudoterminal {
492495
}
493496
return;
494497
}
498+
case keys.end:
495499
case keys.ctrlE: {
496500
if (this._state == "prompt") {
497501
// Move the cursor to the end of the line

0 commit comments

Comments
 (0)