mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Merge pull request #183678 from microsoft/tyriar/135022
Force new terminal editor action to open in same locked group
This commit is contained in:
commit
73d3a29de5
|
@ -59,6 +59,7 @@ import { FileKind } from 'vs/platform/files/common/files';
|
||||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||||
import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
|
import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
|
||||||
import { killTerminalIcon, newTerminalIcon } from 'vs/workbench/contrib/terminal/browser/terminalIcons';
|
import { killTerminalIcon, newTerminalIcon } from 'vs/workbench/contrib/terminal/browser/terminalIcons';
|
||||||
|
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
|
|
||||||
export const switchTerminalActionViewItemSeparator = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
|
export const switchTerminalActionViewItemSeparator = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
|
||||||
export const switchTerminalShowTabsTitle = localize('showTerminalTabs', "Show Tabs");
|
export const switchTerminalShowTabsTitle = localize('showTerminalTabs', "Show Tabs");
|
||||||
|
@ -227,6 +228,21 @@ export function registerTerminalActions() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registerTerminalAction({
|
||||||
|
id: TerminalCommandId.CreateTerminalEditorSameGroup,
|
||||||
|
title: { value: localize('workbench.action.terminal.createTerminalEditor', "Create New Terminal in Editor Area"), original: 'Create New Terminal in Editor Area' },
|
||||||
|
f1: false,
|
||||||
|
run: async (c, accessor, args) => {
|
||||||
|
// Force the editor into the same editor group if it's locked. This command is only ever
|
||||||
|
// called when a terminal is the active editor
|
||||||
|
const editorGroupsService = accessor.get(IEditorGroupsService);
|
||||||
|
const instance = await c.service.createTerminal({
|
||||||
|
location: { viewColumn: editorGroupsService.activeGroup.index }
|
||||||
|
});
|
||||||
|
instance.focusWhenReady();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
registerTerminalAction({
|
registerTerminalAction({
|
||||||
id: TerminalCommandId.CreateTerminalEditorSide,
|
id: TerminalCommandId.CreateTerminalEditorSide,
|
||||||
title: { value: localize('workbench.action.terminal.createTerminalEditorSide', "Create New Terminal in Editor Area to the Side"), original: 'Create New Terminal in Editor Area to the Side' },
|
title: { value: localize('workbench.action.terminal.createTerminalEditorSide', "Create New Terminal in Editor Area to the Side"), original: 'Create New Terminal in Editor Area to the Side' },
|
||||||
|
|
|
@ -785,7 +785,7 @@ export function setupTerminalMenus(): void {
|
||||||
|
|
||||||
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||||
command: {
|
command: {
|
||||||
id: TerminalCommandId.CreateTerminalEditor,
|
id: TerminalCommandId.CreateTerminalEditorSameGroup,
|
||||||
title: terminalStrings.new,
|
title: terminalStrings.new,
|
||||||
icon: Codicon.plus
|
icon: Codicon.plus
|
||||||
},
|
},
|
||||||
|
|
|
@ -527,6 +527,7 @@ export const enum TerminalCommandId {
|
||||||
FocusPreviousPane = 'workbench.action.terminal.focusPreviousPane',
|
FocusPreviousPane = 'workbench.action.terminal.focusPreviousPane',
|
||||||
ShowTabs = 'workbench.action.terminal.showTabs',
|
ShowTabs = 'workbench.action.terminal.showTabs',
|
||||||
CreateTerminalEditor = 'workbench.action.createTerminalEditor',
|
CreateTerminalEditor = 'workbench.action.createTerminalEditor',
|
||||||
|
CreateTerminalEditorSameGroup = 'workbench.action.createTerminalEditorSameGroup',
|
||||||
CreateTerminalEditorSide = 'workbench.action.createTerminalEditorSide',
|
CreateTerminalEditorSide = 'workbench.action.createTerminalEditorSide',
|
||||||
FocusTabs = 'workbench.action.terminal.focusTabs',
|
FocusTabs = 'workbench.action.terminal.focusTabs',
|
||||||
FocusNextPane = 'workbench.action.terminal.focusNextPane',
|
FocusNextPane = 'workbench.action.terminal.focusNextPane',
|
||||||
|
|
Loading…
Reference in a new issue