mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 01:17:14 +00:00
added a new right click behaviour matching windows terminal - fixed #7083
This commit is contained in:
parent
512d2dace8
commit
48afeb98a5
3 changed files with 20 additions and 27 deletions
|
@ -609,10 +609,20 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||
protected async handleRightMouseUp (event: MouseEvent): Promise<void> {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
if (this.config.store.terminal.rightClick === 'paste') {
|
||||
if (this.config.store.terminal.rightClick === 'paste'
|
||||
|| this.config.store.terminal.rightClick === 'clipboard') {
|
||||
const duration = Date.now() - this.rightMouseDownTime
|
||||
if (duration < 250) {
|
||||
this.paste()
|
||||
if (this.config.store.terminal.rightClick === 'paste') {
|
||||
this.paste()
|
||||
} else if (this.config.store.terminal.rightClick === 'clipboard') {
|
||||
if (this.frontend?.getSelection()) {
|
||||
this.frontend.copySelection()
|
||||
this.frontend.clearSelection()
|
||||
} else {
|
||||
this.paste()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.platform.popupContextMenu(await this.buildContextMenu(), event)
|
||||
}
|
||||
|
|
|
@ -71,32 +71,15 @@ div.mt-4
|
|||
.header
|
||||
.title(translate) Right click
|
||||
.description(*ngIf='config.store.terminal.rightClick == "paste"', translate) Long-click for context menu
|
||||
.btn-group(
|
||||
|
||||
select.form-control(
|
||||
[(ngModel)]='config.store.terminal.rightClick',
|
||||
(ngModelChange)='config.save()',
|
||||
ngbRadioGroup
|
||||
(ngModelChange)='config.save()'
|
||||
)
|
||||
label.btn.btn-secondary(ngbButtonLabel)
|
||||
input(
|
||||
type='radio',
|
||||
ngbButton,
|
||||
value='off'
|
||||
)
|
||||
span(translate) Off
|
||||
label.btn.btn-secondary(ngbButtonLabel)
|
||||
input(
|
||||
type='radio',
|
||||
ngbButton,
|
||||
value='menu'
|
||||
)
|
||||
span(translate) Context menu
|
||||
label.btn.btn-secondary(ngbButtonLabel)
|
||||
input(
|
||||
type='radio',
|
||||
ngbButton,
|
||||
value='paste'
|
||||
)
|
||||
span(translate) Paste
|
||||
option(ngValue='off', translate) Off
|
||||
option(ngValue='menu', translate) Context menu
|
||||
option(ngValue='paste', translate) Paste
|
||||
option(ngValue='clipboard', translate) Paste if no selection, else copy
|
||||
|
||||
.form-line
|
||||
.header
|
||||
|
|
|
@ -122,7 +122,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||
[Platform.Windows]: {
|
||||
terminal: {
|
||||
font: 'Consolas',
|
||||
rightClick: 'paste',
|
||||
rightClick: 'clipboard',
|
||||
pasteOnMiddleClick: false,
|
||||
copyOnSelect: true,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue