mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-04 19:35:13 +03:00
added a select-all shortcut - fixes #3081
This commit is contained in:
parent
797265abb1
commit
247cf6f93e
@ -162,6 +162,9 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
case 'paste':
|
||||
this.paste()
|
||||
break
|
||||
case 'select-all':
|
||||
this.frontend?.selectAll()
|
||||
break
|
||||
case 'clear':
|
||||
this.frontend?.clear()
|
||||
break
|
||||
|
@ -97,6 +97,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
clear: [
|
||||
'⌘-K',
|
||||
],
|
||||
'select-all': ['⌘-A'],
|
||||
'zoom-in': [
|
||||
'⌘-=',
|
||||
'⌘-Shift-=',
|
||||
@ -142,6 +143,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
paste: [
|
||||
'Ctrl-Shift-V',
|
||||
],
|
||||
'select-all': ['Ctrl-Shift-A'],
|
||||
clear: [],
|
||||
'zoom-in': [
|
||||
'Ctrl-=',
|
||||
@ -185,6 +187,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
paste: [
|
||||
'Ctrl-Shift-V',
|
||||
],
|
||||
'select-all': ['Ctrl-Shift-A'],
|
||||
clear: [],
|
||||
'zoom-in': [
|
||||
'Ctrl-=',
|
||||
|
@ -62,6 +62,7 @@ export abstract class Frontend {
|
||||
|
||||
abstract getSelection (): string
|
||||
abstract copySelection (): void
|
||||
abstract selectAll (): void
|
||||
abstract clearSelection (): void
|
||||
abstract focus (): void
|
||||
abstract write (data: string): void
|
||||
|
@ -33,6 +33,12 @@ export class HTermFrontend extends Frontend {
|
||||
this.term.copySelectionToClipboard()
|
||||
}
|
||||
|
||||
selectAll (): void {
|
||||
const content = this.term.getDocument().body.children[0]
|
||||
const selection = content.ownerDocument.defaultView.getSelection()
|
||||
selection.setBaseAndExtent(content, 0, content, 1)
|
||||
}
|
||||
|
||||
clearSelection (): void {
|
||||
this.term.getDocument().getSelection().removeAllRanges()
|
||||
}
|
||||
|
@ -186,6 +186,10 @@ export class XTermFrontend extends Frontend {
|
||||
}
|
||||
}
|
||||
|
||||
selectAll (): void {
|
||||
this.xterm.selectAll()
|
||||
}
|
||||
|
||||
clearSelection (): void {
|
||||
this.xterm.clearSelection()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user