提交 3b9f57b3 编写于 作者: D Daniel Imms

Shift+right click should open ctx menu when copyPaste is set

Fixes #92989
上级 bd36bf5d
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册