mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
parent
c4e35f0f03
commit
8fc2765204
|
@ -1776,6 +1776,15 @@ export function refreshTerminalActions(detectedProfiles: ITerminalProfile[]) {
|
|||
type: 'string',
|
||||
enum: profileEnum.values,
|
||||
markdownEnumDescriptions: profileEnum.markdownDescriptions
|
||||
},
|
||||
location: {
|
||||
description: localize('newWithProfile.location', "Where to create the terminal"),
|
||||
type: 'string',
|
||||
enum: ['view', 'editor'],
|
||||
enumDescriptions: [
|
||||
localize('newWithProfile.location.view', 'Create the terminal in the terminal view'),
|
||||
localize('newWithProfile.location.editor', 'Create the terminal in the editor'),
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1783,7 +1792,11 @@ export function refreshTerminalActions(detectedProfiles: ITerminalProfile[]) {
|
|||
},
|
||||
});
|
||||
}
|
||||
async run(accessor: ServicesAccessor, eventOrOptionsOrProfile: MouseEvent | ICreateTerminalOptions | ITerminalProfile | { profileName: string } | undefined, profile?: ITerminalProfile) {
|
||||
async run(
|
||||
accessor: ServicesAccessor,
|
||||
eventOrOptionsOrProfile: MouseEvent | ICreateTerminalOptions | ITerminalProfile | { profileName: string; location?: 'view' | 'editor' | unknown } | undefined,
|
||||
profile?: ITerminalProfile
|
||||
) {
|
||||
const c = getTerminalServices(accessor);
|
||||
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
||||
const commandService = accessor.get(ICommandService);
|
||||
|
@ -1799,6 +1812,12 @@ export function refreshTerminalActions(detectedProfiles: ITerminalProfile[]) {
|
|||
throw new Error(`Could not find terminal profile "${eventOrOptionsOrProfile.profileName}"`);
|
||||
}
|
||||
options = { config };
|
||||
if ('location' in eventOrOptionsOrProfile) {
|
||||
switch (eventOrOptionsOrProfile.location) {
|
||||
case 'editor': options.location = TerminalLocation.Editor; break;
|
||||
case 'view': options.location = TerminalLocation.Panel; break;
|
||||
}
|
||||
}
|
||||
} else if (isMouseEvent(eventOrOptionsOrProfile) || isPointerEvent(eventOrOptionsOrProfile) || isKeyboardEvent(eventOrOptionsOrProfile)) {
|
||||
event = eventOrOptionsOrProfile;
|
||||
options = profile ? { config: profile } : undefined;
|
||||
|
|
Loading…
Reference in a new issue