Add terminal creation target setting (#126516)
This commit is contained in:
parent
22e27ffcc2
commit
d5fdadad39
10 changed files with 63 additions and 39 deletions
|
@ -60,6 +60,7 @@ export const enum TerminalSettingId {
|
|||
CursorWidth = 'terminal.integrated.cursorWidth',
|
||||
Scrollback = 'terminal.integrated.scrollback',
|
||||
DetectLocale = 'terminal.integrated.detectLocale',
|
||||
CreationTarget = 'terminal.integrated.creationTarget',
|
||||
GpuAcceleration = 'terminal.integrated.gpuAcceleration',
|
||||
RightClickBehavior = 'terminal.integrated.rightClickBehavior',
|
||||
Cwd = 'terminal.integrated.cwd',
|
||||
|
|
|
@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
|
|||
import { FindReplaceState } from 'vs/editor/contrib/find/findState';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IOffProcessTerminalService, IShellLaunchConfig, ITerminalChildProcess, ITerminalDimensions, ITerminalLaunchError, ITerminalProfile, ITerminalTabLayoutInfoById, TerminalIcon, TitleEventSource, TerminalShellType } from 'vs/platform/terminal/common/terminal';
|
||||
import { ICommandTracker, INavigationMode, IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { ICommandTracker, INavigationMode, IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalProcessExtHostProxy, TerminalLocation } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import type { Terminal as XTermTerminal } from 'xterm';
|
||||
import type { SearchAddon as XTermSearchAddon } from 'xterm-addon-search';
|
||||
import type { Unicode11Addon as XTermUnicode11Addon } from 'xterm-addon-unicode11';
|
||||
|
@ -91,11 +91,6 @@ export const enum TerminalConnectionState {
|
|||
Connected
|
||||
}
|
||||
|
||||
export const enum TerminalTarget {
|
||||
TerminalView = 'view',
|
||||
Editor = 'editor'
|
||||
}
|
||||
|
||||
export interface ICreateTerminalOptions {
|
||||
/**
|
||||
* The shell launch config or profile to launch with, when not specified the default terminal
|
||||
|
@ -110,7 +105,7 @@ export interface ICreateTerminalOptions {
|
|||
/**
|
||||
* Where to create the terminal, when not specified the default target will be used.
|
||||
*/
|
||||
target?: TerminalTarget;
|
||||
target?: TerminalLocation;
|
||||
}
|
||||
|
||||
export interface ITerminalService {
|
||||
|
@ -329,7 +324,7 @@ export interface ITerminalInstance {
|
|||
*/
|
||||
processId: number | undefined;
|
||||
|
||||
target?: TerminalTarget;
|
||||
target?: TerminalLocation;
|
||||
|
||||
/**
|
||||
* The id of a persistent process. This is defined if this is a terminal created by a pty host
|
||||
|
|
|
@ -30,9 +30,9 @@ import { ILocalTerminalService, ITerminalProfile, TerminalSettingId, TitleEventS
|
|||
import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands';
|
||||
import { FindInFilesCommand, IFindInFilesArgs } from 'vs/workbench/contrib/search/browser/searchActions';
|
||||
import { Direction, IRemoteTerminalService, ITerminalInstance, ITerminalInstanceService, ITerminalService, TerminalTarget } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { Direction, IRemoteTerminalService, ITerminalInstance, ITerminalInstanceService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { TerminalQuickAccessProvider } from 'vs/workbench/contrib/terminal/browser/terminalQuickAccess';
|
||||
import { IRemoteTerminalAttachTarget, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FIND_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_NOT_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TerminalCommandId, TERMINAL_ACTION_CATEGORY } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IRemoteTerminalAttachTarget, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FIND_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_NOT_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_TABS_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TerminalCommandId, TerminalLocation, TERMINAL_ACTION_CATEGORY } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { terminalStrings } from 'vs/workbench/contrib/terminal/common/terminalStrings';
|
||||
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
|
||||
import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
|
@ -205,7 +205,7 @@ export function registerTerminalActions() {
|
|||
const terminalService = accessor.get(ITerminalService);
|
||||
// TODO: Await openEditor
|
||||
terminalService.createTerminal({
|
||||
target: TerminalTarget.Editor
|
||||
target: TerminalLocation.Editor
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -1160,7 +1160,10 @@ export function registerTerminalActions() {
|
|||
async run(accessor: ServicesAccessor, args?: { cwd?: string }) {
|
||||
const terminalService = accessor.get(ITerminalService);
|
||||
if (terminalService.isProcessSupportRegistered) {
|
||||
const instance = terminalService.createTerminal({ cwd: args?.cwd });
|
||||
const instance = terminalService.createTerminal(
|
||||
{
|
||||
cwd: args?.cwd
|
||||
});
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
|
@ -1591,7 +1594,11 @@ export function registerTerminalActions() {
|
|||
// Don't create the instance if the workspace picker was canceled
|
||||
return;
|
||||
}
|
||||
instance = terminalService.createTerminal({ cwd: workspace.uri });
|
||||
instance = terminalService.createTerminal(
|
||||
{
|
||||
cwd: workspace.uri
|
||||
}
|
||||
);
|
||||
}
|
||||
terminalService.setActiveInstance(instance);
|
||||
}
|
||||
|
@ -1829,7 +1836,10 @@ export function registerTerminalActions() {
|
|||
if (quickSelectProfiles) {
|
||||
const profile = quickSelectProfiles.find(profile => profile.profileName === profileSelection);
|
||||
if (profile) {
|
||||
const instance = terminalService.createTerminal({ config: profile });
|
||||
const instance = terminalService.createTerminal(
|
||||
{
|
||||
config: profile
|
||||
});
|
||||
terminalService.setActiveInstance(instance);
|
||||
} else {
|
||||
console.warn(`No profile with name "${profileSelection}"`);
|
||||
|
|
|
@ -34,9 +34,7 @@ export class TerminalEditor extends EditorPane {
|
|||
}
|
||||
|
||||
override async setInput(newInput: TerminalEditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken) {
|
||||
if (!context.newInGroup) {
|
||||
this._editorInput?.terminalInstance?.detachFromElement();
|
||||
}
|
||||
this._editorInput?.terminalInstance?.detachFromElement();
|
||||
this._editorInput = newInput;
|
||||
await super.setInput(newInput, options, context, token);
|
||||
this._editorInput.terminalInstance?.attachToElement(this._parentElement!);
|
||||
|
@ -62,7 +60,6 @@ export class TerminalEditor extends EditorPane {
|
|||
super.setVisible(visible, group);
|
||||
return this._editorInput?.terminalInstance?.setVisible(visible);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class TerminalInputSerializer implements IEditorInputSerializer {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ITerminalEditorService, ITerminalInstance, TerminalTarget } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalEditorService, ITerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput';
|
||||
import { TerminalLocation } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
||||
export class TerminalEditorService implements ITerminalEditorService {
|
||||
|
@ -21,7 +22,7 @@ export class TerminalEditorService implements ITerminalEditorService {
|
|||
}
|
||||
|
||||
async createEditor(instance: ITerminalInstance): Promise<void> {
|
||||
instance.target = TerminalTarget.Editor;
|
||||
instance.target = TerminalLocation.Editor;
|
||||
const input = new TerminalEditorInput(instance);
|
||||
this._editorInputs.set(instance.instanceId, input);
|
||||
await this._editorService.openEditor(input, {
|
||||
|
|
|
@ -24,12 +24,12 @@ import { activeContrastBorder, scrollbarSliderActiveBackground, scrollbarSliderB
|
|||
import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { EDITOR_PANE_BACKGROUND, PANEL_BACKGROUND, SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/widgets/widgetManager';
|
||||
import { ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_VIEW_ID, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, INavigationMode, DEFAULT_COMMANDS_TO_SKIP_SHELL, TERMINAL_CREATION_COMMANDS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, SUGGESTED_RENDERER_TYPE, ITerminalProfileResolverService } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_VIEW_ID, KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS, INavigationMode, DEFAULT_COMMANDS_TO_SKIP_SHELL, TERMINAL_CREATION_COMMANDS, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, SUGGESTED_RENDERER_TYPE, ITerminalProfileResolverService, TerminalLocation } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { ansiColorIdentifiers, ansiColorMap, TERMINAL_BACKGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';
|
||||
import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper';
|
||||
import { TerminalLinkManager } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkManager';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { ITerminalInstanceService, ITerminalInstance, ITerminalExternalLinkProvider, IRequestAddInstanceToGroupEvent, TerminalTarget } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalInstanceService, ITerminalInstance, ITerminalExternalLinkProvider, IRequestAddInstanceToGroupEvent } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager';
|
||||
import type { Terminal as XTermTerminal, IBuffer, ITerminalAddon, RendererType, ITheme } from 'xterm';
|
||||
import type { SearchAddon, ISearchOptions } from 'xterm-addon-search';
|
||||
|
@ -150,7 +150,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
|
||||
readonly statusList: ITerminalStatusList = new TerminalStatusList();
|
||||
disableLayout: boolean = false;
|
||||
target?: TerminalTarget;
|
||||
target?: TerminalLocation;
|
||||
get instanceId(): number { return this._instanceId; }
|
||||
get resource(): URI {
|
||||
return URI.from({
|
||||
|
@ -1798,7 +1798,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
const location = this._viewDescriptorService.getViewLocationById(TERMINAL_VIEW_ID)!;
|
||||
const foregroundColor = theme.getColor(TERMINAL_FOREGROUND_COLOR);
|
||||
let backgroundColor: Color | undefined;
|
||||
if (this.target === TerminalTarget.Editor) {
|
||||
if (this.target === TerminalLocation.Editor) {
|
||||
backgroundColor = theme.getColor(TERMINAL_BACKGROUND_COLOR) || theme.getColor(EDITOR_PANE_BACKGROUND);
|
||||
} else {
|
||||
backgroundColor = theme.getColor(TERMINAL_BACKGROUND_COLOR) || (location === ViewContainerLocation.Sidebar ? theme.getColor(SIDE_BAR_BACKGROUND) : theme.getColor(PANEL_BACKGROUND));
|
||||
|
|
|
@ -19,13 +19,13 @@ import { IKeyMods, IPickOptions, IQuickInputButton, IQuickInputService, IQuickPi
|
|||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ILocalTerminalService, IOffProcessTerminalService, IShellLaunchConfig, ITerminalLaunchError, ITerminalProfile, ITerminalProfileObject, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalSettingId, TerminalSettingPrefix } from 'vs/platform/terminal/common/terminal';
|
||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { IRemoteTerminalService, ITerminalExternalLinkProvider, ITerminalInstance, ITerminalService, ITerminalGroup, TerminalConnectionState, ITerminalProfileProvider, ICreateTerminalOptions, TerminalTarget, ITerminalEditorService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { IRemoteTerminalService, ITerminalExternalLinkProvider, ITerminalInstance, ITerminalService, ITerminalGroup, TerminalConnectionState, ITerminalProfileProvider, ICreateTerminalOptions, ITerminalEditorService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { IEditableData, IViewDescriptorService, IViewsService, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper';
|
||||
import { TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance';
|
||||
import { TerminalGroup } from 'vs/workbench/contrib/terminal/browser/terminalGroup';
|
||||
import { TerminalViewPane } from 'vs/workbench/contrib/terminal/browser/terminalView';
|
||||
import { IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalProcessExtHostProxy, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE, TERMINAL_VIEW_ID, KEYBINDING_CONTEXT_TERMINAL_COUNT, KEYBINDING_CONTEXT_TERMINAL_TABS_MOUSE, KEYBINDING_CONTEXT_TERMINAL_GROUP_COUNT, ITerminalProfileContribution } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalProcessExtHostProxy, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE, TERMINAL_VIEW_ID, KEYBINDING_CONTEXT_TERMINAL_COUNT, KEYBINDING_CONTEXT_TERMINAL_TABS_MOUSE, KEYBINDING_CONTEXT_TERMINAL_GROUP_COUNT, ITerminalProfileContribution, TerminalLocation } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ILifecycleService, ShutdownReason, WillShutdownEvent } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
|
@ -279,9 +279,7 @@ export class TerminalService implements ITerminalService {
|
|||
if (!terminalInstance) {
|
||||
// create group and terminal
|
||||
const config = { attachPersistentProcess: terminalLayout.terminal! } as IShellLaunchConfig;
|
||||
terminalInstance = this.createTerminal(
|
||||
config
|
||||
);
|
||||
terminalInstance = this.createTerminal(config);
|
||||
group = this.getGroupForInstance(terminalInstance);
|
||||
if (groupLayout.isActive) {
|
||||
activeGroup = group;
|
||||
|
@ -554,6 +552,9 @@ export class TerminalService implements ITerminalService {
|
|||
}
|
||||
|
||||
setActiveInstance(terminalInstance: ITerminalInstance): void {
|
||||
if (this.configHelper.config.creationTarget === TerminalLocation.Editor) {
|
||||
return;
|
||||
}
|
||||
// If this was a hideFromUser terminal created by the API this was triggered by show,
|
||||
// in which case we need to create the terminal group
|
||||
if (terminalInstance.shellLaunchConfig.hideFromUser) {
|
||||
|
@ -764,7 +765,7 @@ export class TerminalService implements ITerminalService {
|
|||
}
|
||||
|
||||
moveToEditor(source: ITerminalInstance): void {
|
||||
if (source.target === TerminalTarget.Editor) {
|
||||
if (source.target === TerminalLocation.Editor) {
|
||||
return;
|
||||
}
|
||||
const sourceGroup = this.getGroupForInstance(source);
|
||||
|
@ -785,10 +786,10 @@ export class TerminalService implements ITerminalService {
|
|||
}
|
||||
}
|
||||
|
||||
if (source.target !== TerminalTarget.Editor) {
|
||||
if (source.target !== TerminalLocation.Editor) {
|
||||
return;
|
||||
}
|
||||
source.target = TerminalTarget.TerminalView;
|
||||
source.target = TerminalLocation.TerminalView;
|
||||
|
||||
// TODO: Share code with joinInstances - move into terminal group service
|
||||
const group = this._instantiationService.createInstance(TerminalGroup, this._terminalContainer, undefined);
|
||||
|
@ -899,6 +900,9 @@ export class TerminalService implements ITerminalService {
|
|||
}
|
||||
|
||||
async showPanel(focus?: boolean): Promise<void> {
|
||||
if (this.configHelper.config.creationTarget === TerminalLocation.Editor) {
|
||||
return;
|
||||
}
|
||||
const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID)
|
||||
?? await this._viewsService.openView(TERMINAL_VIEW_ID, focus);
|
||||
pane?.setExpanded(true);
|
||||
|
@ -1043,11 +1047,11 @@ export class TerminalService implements ITerminalService {
|
|||
// create split, only valid if there's an active instance
|
||||
instance = this.splitInstance(activeInstance, value.profile, cwd);
|
||||
} else {
|
||||
instance = this.createTerminal({ config: value.profile, cwd });
|
||||
instance = this.createTerminal({ target: this.configHelper.config.creationTarget, config: value.profile, cwd });
|
||||
}
|
||||
}
|
||||
|
||||
if (instance) {
|
||||
if (instance && this.configHelper.config.creationTarget === TerminalLocation.TerminalView) {
|
||||
this.showPanel(true);
|
||||
this.setActiveInstance(instance);
|
||||
return instance;
|
||||
|
@ -1185,7 +1189,7 @@ export class TerminalService implements ITerminalService {
|
|||
}
|
||||
|
||||
let instance: ITerminalInstance;
|
||||
if (options?.target === TerminalTarget.Editor) {
|
||||
if (options?.target === TerminalLocation.Editor || this.configHelper.config.creationTarget === TerminalLocation.Editor) {
|
||||
instance = this.createInstance(shellLaunchConfig);
|
||||
this._terminalEditorService.createEditor(instance);
|
||||
this._initInstanceListeners(instance);
|
||||
|
|
|
@ -9,14 +9,14 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
|||
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { ITerminalInstance, ITerminalInstanceService, ITerminalService, TerminalTarget } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalInstance, ITerminalInstanceService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { IS_SPLIT_TERMINAL_CONTEXT_KEY, KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IS_SPLIT_TERMINAL_CONTEXT_KEY, KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION, TerminalCommandId, TerminalLocation } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
|
@ -107,7 +107,7 @@ export class TerminalTabList extends WorkbenchList<ITerminalInstance> {
|
|||
this._terminalService.onDidChangeConnectionState(() => this.refresh());
|
||||
this._themeService.onDidColorThemeChange(() => this.refresh());
|
||||
this._terminalService.onActiveInstanceChanged(e => {
|
||||
if (e && e.target !== TerminalTarget.Editor) {
|
||||
if (e && e.target !== TerminalLocation.Editor) {
|
||||
const i = this._terminalService.terminalInstances.indexOf(e);
|
||||
this.setSelection([i]);
|
||||
this.reveal(i);
|
||||
|
|
|
@ -207,6 +207,12 @@ export interface ITerminalConfiguration {
|
|||
focusMode: 'singleClick' | 'doubleClick';
|
||||
},
|
||||
bellDuration: number;
|
||||
creationTarget: TerminalLocation;
|
||||
}
|
||||
|
||||
export const enum TerminalLocation {
|
||||
TerminalView = 'view',
|
||||
Editor = 'editor'
|
||||
}
|
||||
|
||||
export const DEFAULT_LOCAL_ECHO_EXCLUDE: ReadonlyArray<string> = ['vim', 'vi', 'nano', 'tmux'];
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import { Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { localize } from 'vs/nls';
|
||||
import { DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, TerminalCursorStyle, DEFAULT_COMMANDS_TO_SKIP_SHELL, SUGGESTIONS_FONT_WEIGHT, MINIMUM_FONT_WEIGHT, MAXIMUM_FONT_WEIGHT, DEFAULT_LOCAL_ECHO_EXCLUDE } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, TerminalCursorStyle, DEFAULT_COMMANDS_TO_SKIP_SHELL, SUGGESTIONS_FONT_WEIGHT, MINIMUM_FONT_WEIGHT, MAXIMUM_FONT_WEIGHT, DEFAULT_LOCAL_ECHO_EXCLUDE, TerminalLocation } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import { isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
@ -59,6 +59,16 @@ const terminalConfiguration: IConfigurationNode = {
|
|||
default: 'right',
|
||||
description: localize('terminal.integrated.tabs.location', "Controls the location of the terminal tabs, either to the left or right of the actual terminal(s).")
|
||||
},
|
||||
[TerminalSettingId.CreationTarget]: {
|
||||
type: 'string',
|
||||
enum: [TerminalLocation.Editor, TerminalLocation.TerminalView],
|
||||
enumDescriptions: [
|
||||
localize('terminal.integrated.creationTarget.editor', "Create terminals in the editor"),
|
||||
localize('terminal.integrated.creationTarget.view', "Create terminals in the terminal view")
|
||||
],
|
||||
default: 'view',
|
||||
description: localize('terminal.integrated.creationTarget', "Controls where newly created terminals will appear.")
|
||||
},
|
||||
[TerminalSettingId.TabsFocusMode]: {
|
||||
type: 'string',
|
||||
enum: ['singleClick', 'doubleClick'],
|
||||
|
|
Loading…
Reference in a new issue