Skip to content

Commit 3514871

Browse files
authored
Merge pull request microsoft#210423 from microsoft/tyriar/210395
Ignore non-handled CSI sequences in terminal suggest
2 parents 9d2deb6 + 46201f8 commit 3514871

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
416416
}
417417
}
418418
// Left
419-
if (data === '\x1b[D') {
419+
else if (data === '\x1b[D') {
420420
// If left goes beyond where the completion was requested, hide
421421
if (this._cursorIndexDelta > 0) {
422422
handled = true;
@@ -425,14 +425,18 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
425425
}
426426
}
427427
// Right
428-
if (data === '\x1b[C') {
428+
else if (data === '\x1b[C') {
429429
// If right requests beyond where the completion was requested (potentially accepting a shell completion), hide
430430
if (this._additionalInput?.length !== this._cursorIndexDelta) {
431431
handled = true;
432432
this._cursorIndexDelta++;
433433
handledCursorDelta++;
434434
}
435435
}
436+
// Other CSI sequence (ignore)
437+
else if (data.match(/^\x1b\[.+[a-z@\^`{\|}~]$/i)) {
438+
handled = true;
439+
}
436440
if (data.match(/^[a-z0-9]$/i)) {
437441

438442
// TODO: There is a race here where the completions may come through after new character presses because of conpty's rendering!

0 commit comments

Comments
 (0)