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