Use switch, allow Linux to paste regular clipboard too

This commit is contained in:
Daniel Imms 2024-04-02 06:58:17 -07:00
parent 6f989eb488
commit dc4e8af04b
No known key found for this signature in database
GPG key ID: E5CF412B63651C69
2 changed files with 20 additions and 12 deletions

View file

@ -129,12 +129,16 @@ export class TerminalEditor extends EditorPane {
}
if (event.which === 2) {
if (isLinux) {
// Drop selection and focus terminal on Linux to enable middle button paste when click
// occurs on the selection itself.
terminal.focus();
} else if (this._terminalConfigurationService.config.middleClickBehavior === 'paste') {
terminal.paste();
switch (this._terminalConfigurationService.config.middleClickBehavior) {
case 'paste':
terminal.paste();
break;
case 'default':
default:
// Drop selection and focus terminal on Linux to enable middle button paste
// when click occurs on the selection itself.
terminal.focus();
break;
}
} else if (event.which === 3) {
const rightClickBehavior = this._terminalConfigurationService.config.rightClickBehavior;

View file

@ -340,12 +340,16 @@ export class TerminalTabbedView extends Disposable {
}
if (event.which === 2) {
if (isLinux) {
// Drop selection and focus terminal on Linux to enable middle button paste when click
// occurs on the selection itself.
terminal.focus();
} else if (this._terminalConfigurationService.config.middleClickBehavior === 'paste') {
terminal.paste();
switch (this._terminalConfigurationService.config.middleClickBehavior) {
case 'paste':
terminal.paste();
break;
case 'default':
default:
// Drop selection and focus terminal on Linux to enable middle button paste
// when click occurs on the selection itself.
terminal.focus();
break;
}
} else if (event.which === 3) {
const rightClickBehavior = this._terminalConfigurationService.config.rightClickBehavior;