From 389e05c83238afcfae7ee187d61bf40ac31f6f53 Mon Sep 17 00:00:00 2001 From: Hisam Fahri Date: Sun, 24 Apr 2022 11:57:59 +0700 Subject: [PATCH] feat(hotkey): add the delete entire line hotkey --- tabby-terminal/src/api/baseTerminalTab.component.ts | 5 +++++ tabby-terminal/src/config.ts | 3 +++ tabby-terminal/src/hotkeys.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index 48bdf5b7..032bae40 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -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') diff --git a/tabby-terminal/src/config.ts b/tabby-terminal/src/config.ts index 05507d8a..31e1f55e 100644 --- a/tabby-terminal/src/config.ts +++ b/tabby-terminal/src/config.ts @@ -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', diff --git a/tabby-terminal/src/hotkeys.ts b/tabby-terminal/src/hotkeys.ts index 8fde5f77..878cd2fa 100644 --- a/tabby-terminal/src/hotkeys.ts +++ b/tabby-terminal/src/hotkeys.ts @@ -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'),