Skip to content

Commit fd7c6fb

Browse files
committed
Ensure new terminal windows are unlocked
1 parent cc70ca4 commit fd7c6fb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import { killTerminalIcon, newTerminalIcon } from './terminalIcons.js';
6363
import { ITerminalQuickPickItem } from './terminalProfileQuickpick.js';
6464
import { TerminalTabList } from './terminalTabsList.js';
6565
import { ResourceContextKey } from '../../../common/contextkeys.js';
66+
import { timeout } from '../../../../base/common/async.js';
6667

6768
export const switchTerminalActionViewItemSeparator = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
6869
export const switchTerminalShowTabsTitle = localize('showTerminalTabs', "Show Tabs");
@@ -329,7 +330,9 @@ export function registerTerminalActions() {
329330
// called when a terminal is the active editor
330331
const editorGroupsService = accessor.get(IEditorGroupsService);
331332
const instance = await c.service.createTerminal({
332-
location: { viewColumn: editorGroupToColumn(editorGroupsService, editorGroupsService.activeGroup) }
333+
location: {
334+
viewColumn: editorGroupToColumn(editorGroupsService, editorGroupsService.activeGroup),
335+
}
333336
});
334337
await instance.focusWhenReady();
335338
}
@@ -363,6 +366,12 @@ export function registerTerminalActions() {
363366
},
364367
});
365368
await instance.focusWhenReady();
369+
// HACK: Since it's a new window it should be unlocked, despite the configuration, this
370+
// is using a timeout as it's auto locked after several events firing in code internal
371+
// to the editor.
372+
await timeout(100);
373+
const g = c.editorService.getInputFromResource(instance.resource).group;
374+
g?.lock(false);
366375
}
367376
});
368377

0 commit comments

Comments
 (0)