feat(hotkey): add the delete entire line hotkey

This commit is contained in:
Hisam Fahri 2022-04-24 11:57:59 +07:00
parent 500a42c1f7
commit 389e05c832
No known key found for this signature in database
GPG key ID: B21C64808DAB52E9
3 changed files with 12 additions and 0 deletions

View file

@ -244,6 +244,11 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
}[this.hostApp.platform])
})
break
case 'delete-line':
this.forEachFocusedTerminalPane(tab => {
tab.sendInput('\x1bw')
})
break
case 'delete-previous-word':
this.forEachFocusedTerminalPane(tab => {
tab.sendInput('\x1b\x7f')

View file

@ -104,6 +104,7 @@ export class TerminalConfigProvider extends ConfigProvider {
'previous-word': ['⌥-Left'],
'next-word': ['⌥-Right'],
'delete-previous-word': ['⌥-Backspace'],
'delete-line': ['⌘-Backspace'],
'delete-next-word': ['⌥-Delete'],
search: [
'⌘-F',
@ -147,6 +148,7 @@ export class TerminalConfigProvider extends ConfigProvider {
'previous-word': ['Ctrl-Left'],
'next-word': ['Ctrl-Right'],
'delete-previous-word': ['Ctrl-Backspace'],
'delete-line': ['Ctrl-Shift-Backspace'],
'delete-next-word': ['Ctrl-Delete'],
search: [
'Ctrl-Shift-F',
@ -188,6 +190,7 @@ export class TerminalConfigProvider extends ConfigProvider {
'previous-word': ['Ctrl-Left'],
'next-word': ['Ctrl-Right'],
'delete-previous-word': ['Ctrl-Backspace'],
'delete-line': ['Ctrl-Shift-Backspace'],
'delete-next-word': ['Ctrl-Delete'],
search: [
'Ctrl-Shift-F',

View file

@ -33,6 +33,10 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
id: 'delete-previous-word',
name: this.translate.instant('Delete previous word'),
},
{
id: 'delete-line',
name: this.translate.instant('Delete entire line'),
},
{
id: 'delete-next-word',
name: this.translate.instant('Delete next word'),