-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add 'New Terminal (Select a Container)' action to Terminal and …
…terminal's context menu Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
- Loading branch information
1 parent
41ffb1c
commit 710a43b
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
code/src/vs/workbench/contrib/terminal/browser/che/terminalMenus.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2023 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
***********************************************************************/ | ||
/* eslint-disable header/header */ | ||
|
||
import { localize } from 'vs/nls'; | ||
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; | ||
import { TerminalMenuBarGroup } from 'vs/workbench/contrib/terminal/browser/terminalMenus'; | ||
|
||
// see enum ContextMenuGroup in the terminalMenus | ||
const CONTEXT_MENU_GROUP_CREATE = '1_create'; | ||
const NEW_TERMINAL_IN_CONTAINER_COMMAND_ID = 'che-terminal.new'; | ||
const NEW_TERMINAL_IN_CONTAINER_TITLE = localize('newTerminal.selectContainer.title', 'New Terminal (Select a Container)'); | ||
|
||
export function setupCheTerminalMenus(): void { | ||
MenuRegistry.appendMenuItems( | ||
[ | ||
{ | ||
id: MenuId.MenubarTerminalMenu, | ||
item: { | ||
group: TerminalMenuBarGroup.Create, | ||
command: { | ||
id: NEW_TERMINAL_IN_CONTAINER_COMMAND_ID, | ||
title: NEW_TERMINAL_IN_CONTAINER_TITLE | ||
}, | ||
order: 1.5 | ||
} | ||
} | ||
] | ||
); | ||
|
||
MenuRegistry.appendMenuItems( | ||
[ | ||
{ | ||
id: MenuId.TerminalInstanceContext, | ||
item: { | ||
command: { | ||
id: NEW_TERMINAL_IN_CONTAINER_COMMAND_ID, | ||
title: NEW_TERMINAL_IN_CONTAINER_TITLE | ||
}, | ||
group: CONTEXT_MENU_GROUP_CREATE | ||
} | ||
} | ||
] | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters