Skip to content

Commit 5c35efe

Browse files
authored
Merge pull request microsoft#161989 from microsoft/tyriar/160914_2
Prevent exception in attachToElement
2 parents c0f5b32 + fa91f63 commit 5c35efe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe
179179
if (pane && !pane.isVisible()) {
180180
await this._viewsService.openView(TERMINAL_VIEW_ID, focus);
181181
}
182-
await instance.focusWhenReady(true);
182+
// Do not await the focus as setVisible must be called immediately to ensure
183+
// something else didn't steal focus
184+
instance.focusWhenReady(true);
183185
// HACK: as a workaround for https://github.com/microsoft/vscode/issues/134692,
184186
// this will trigger a forced refresh of the viewport to sync the viewport and scroll bar.
185187
// This can likely be removed after https://github.com/xtermjs/xterm.js/issues/291 is

0 commit comments

Comments
 (0)