Option to disable middle click paste (#1928)

Option to disable middle click paste
This commit is contained in:
Eugene
2019-12-28 23:32:10 +01:00
committed by GitHub
3 changed files with 14 additions and 1 deletions

View File

@@ -353,7 +353,9 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
this.frontend.mouseEvent$.subscribe(async event => { this.frontend.mouseEvent$.subscribe(async event => {
if (event.type === 'mousedown') { if (event.type === 'mousedown') {
if (event.which === 2) { if (event.which === 2) {
this.paste() if (this.config.store.terminal.pasteOnMiddleClick) {
this.paste()
}
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
return return

View File

@@ -64,6 +64,15 @@ h3.mb-3 Terminal
) )
| Paste | Paste
.form-line
.header
.title Paste on middle-click
toggle(
[(ngModel)]='config.store.terminal.pasteOnMiddleClick',
(ngModelChange)='config.save()',
)
.form-line .form-line
.header .header
.title Auto-open a terminal on app start .title Auto-open a terminal on app start

View File

@@ -25,6 +25,7 @@ export class TerminalConfigProvider extends ConfigProvider {
cursorBlink: true, cursorBlink: true,
customShell: '', customShell: '',
rightClick: 'menu', rightClick: 'menu',
pasteOnMiddleClick: true,
copyOnSelect: false, copyOnSelect: false,
scrollOnInput: true, scrollOnInput: true,
workingDirectory: '', workingDirectory: '',
@@ -113,6 +114,7 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: 'clink', shell: 'clink',
profile: 'cmd-clink', profile: 'cmd-clink',
rightClick: 'paste', rightClick: 'paste',
pasteOnMiddleClick: false,
copyOnSelect: true, copyOnSelect: true,
}, },
hotkeys: { hotkeys: {