Skip to content

Commit

Permalink
feat(hotkey): add the delete entire line hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
hisamafahri committed Apr 24, 2022
1 parent 500a42c commit 389e05c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tabby-terminal/src/api/baseTerminalTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 3 additions & 0 deletions tabby-terminal/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions tabby-terminal/src/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 389e05c

Please sign in to comment.