mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 10:27:46 +00:00
parent
69aaa885e2
commit
cf03392bf3
|
@ -320,7 +320,7 @@ export class TerminalInstance implements ITerminalInstance {
|
|||
}
|
||||
|
||||
public clearSelection(): void {
|
||||
document.getSelection().empty();
|
||||
window.getSelection().empty();
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
|
|
|
@ -172,6 +172,15 @@ export class TerminalPanel extends Panel {
|
|||
} else {
|
||||
terminal.paste();
|
||||
}
|
||||
// Clear selection after all click event bubbling is finished on Mac to prevent
|
||||
// right-click selecting a word which is seemed cannot be disabled. There is a
|
||||
// flicker when pasting but this appears to give the best experience if the
|
||||
// setting is enabled.
|
||||
if (platform.isMacintosh) {
|
||||
setTimeout(() => {
|
||||
terminal.clearSelection();
|
||||
}, 0);
|
||||
}
|
||||
this._cancelContextMenu = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue