-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right click to copy selection and paste on Windows #17496
Changes from all commits
dea01a9
fc5a3b5
f2c6556
b8c9d2c
ca0dd70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,25 +149,30 @@ export class TerminalPanel extends Panel { | |
// occurs on the selection itself. | ||
this._terminalService.getActiveInstance().focus(); | ||
} else if (event.which === 3) { | ||
// Trigger the context menu on right click | ||
let anchor: HTMLElement | { x: number, y: number } = this._parentDomElement; | ||
if (event instanceof MouseEvent) { | ||
if (this._terminalService.configHelper.getRightClickCopyPaste()) { | ||
let terminal = this._terminalService.getActiveInstance(); | ||
if (terminal.hasSelection()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just realized that this is actually my code haha, as long as the context menu appears in the correct spot after this change (when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it still works with the change |
||
terminal.copySelection(); | ||
terminal.clearSelection(); | ||
} else { | ||
terminal.paste(); | ||
} | ||
} else { | ||
const standardEvent = new StandardMouseEvent(event); | ||
anchor = { x: standardEvent.posx, y: standardEvent.posy }; | ||
} | ||
|
||
this._contextMenuService.showContextMenu({ | ||
getAnchor: () => anchor, | ||
getActions: () => TPromise.as(this._getContextMenuActions()), | ||
getActionsContext: () => this._parentDomElement, | ||
getKeyBinding: (action) => { | ||
const opts = this._keybindingService.lookupKeybindings(action.id); | ||
if (opts.length > 0) { | ||
return opts[0]; // only take the first one | ||
let anchor: { x: number, y: number } = { x: standardEvent.posx, y: standardEvent.posy }; | ||
this._contextMenuService.showContextMenu({ | ||
getAnchor: () => anchor, | ||
getActions: () => TPromise.as(this._getContextMenuActions()), | ||
getActionsContext: () => this._parentDomElement, | ||
getKeyBinding: (action) => { | ||
const opts = this._keybindingService.lookupKeybindings(action.id); | ||
if (opts.length > 0) { | ||
return opts[0]; // only take the first one | ||
} | ||
return null; | ||
} | ||
return null; | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
})); | ||
this._register(DOM.addDisposableListener(this._parentDomElement, 'click', (event) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems obsolete to me. Let me know if i'm missing something.