diff --git a/src/vs/workbench/contrib/terminal/browser/terminalView.ts b/src/vs/workbench/contrib/terminal/browser/terminalView.ts index 98bd64125233a20817e0b382fa740071d477de18..cb33c1f8f78d69a411aedf8a48e08ddeaae14b76 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalView.ts @@ -232,6 +232,13 @@ export class TerminalViewPane extends ViewPane { if (!terminal) { return; } + + // copyPaste: Shift+right click should open context menu + if (rightClickBehavior === 'copyPaste' && event.shiftKey) { + this._openContextMenu(event); + return; + } + if (rightClickBehavior === 'copyPaste' && terminal.hasSelection()) { await terminal.copySelection(); terminal.clearSelection(); @@ -253,13 +260,7 @@ export class TerminalViewPane extends ViewPane { })); this._register(dom.addDisposableListener(parentDomElement, 'contextmenu', (event: MouseEvent) => { if (!this._cancelContextMenu) { - const standardEvent = new StandardMouseEvent(event); - const anchor: { x: number, y: number } = { x: standardEvent.posx, y: standardEvent.posy }; - this._contextMenuService.showContextMenu({ - getAnchor: () => anchor, - getActions: () => this._getContextMenuActions(), - getActionsContext: () => this._parentDomElement - }); + this._openContextMenu(event); } event.preventDefault(); event.stopImmediatePropagation(); @@ -306,6 +307,16 @@ export class TerminalViewPane extends ViewPane { })); } + private _openContextMenu(event: MouseEvent): void { + const standardEvent = new StandardMouseEvent(event); + const anchor: { x: number, y: number } = { x: standardEvent.posx, y: standardEvent.posy }; + this._contextMenuService.showContextMenu({ + getAnchor: () => anchor, + getActions: () => this._getContextMenuActions(), + getActionsContext: () => this._parentDomElement + }); + } + private _updateTheme(theme?: IColorTheme): void { if (!theme) { theme = this.themeService.getColorTheme();