Skip to content

Commit f72ffc4

Browse files
authored
Merge pull request microsoft#191819 from microsoft/merogge/acc-tab
send `Shift+tab` to the shell
2 parents 95e0d5c + 3ff7e76 commit f72ffc4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
976976
return false;
977977
}
978978

979+
// Prevent default when shift+tab is being sent to the terminal to avoid it bubbling up
980+
// and changing focus https://github.com/microsoft/vscode/issues/188329
981+
if (event.key === 'Tab' && event.shiftKey) {
982+
event.preventDefault();
983+
return true;
984+
}
985+
979986
// Always have alt+F4 skip the terminal on Windows and allow it to be handled by the
980987
// system
981988
if (isWindows && event.altKey && event.key === 'F4' && !event.ctrlKey) {

src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleWidget.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,13 @@ export abstract class TerminalAccessibleWidget extends DisposableStore {
118118
// On escape, hide the accessible buffer and force focus onto the terminal
119119
this.hide(true);
120120
break;
121-
case KeyCode.Tab:
122-
// On tab or shift+tab, hide the accessible buffer and perform the default tab
123-
// behavior
124-
this.hide();
125-
break;
126121
}
127122
}));
128123
this.add(this._editorWidget.onDidFocusEditorText(async () => {
129124
this._terminalService.setActiveInstance(this._instance as ITerminalInstance);
130125
this._xtermElement.classList.add(ClassName.Hide);
131126
}));
127+
this.add(this._editorWidget.onDidBlurEditorText(async () => this.hide()));
132128
}
133129

134130
registerListeners(): void {

0 commit comments

Comments
 (0)