feat(tui/input): map Ctrl+Backspace to delete current line in composer

Provide a portable shortcut for deleting the entire current line when
terminals don’t forward the Command/SUPER modifier (e.g., iTerm2). This
mirrors Cmd+Backspace behavior where supported, without affecting existing
Alt+Backspace (word delete) and Ctrl+H (backspace) bindings.
This commit is contained in:
James Peter
2025-09-08 11:21:48 +10:00
parent f79ccf8bb8
commit c422d92dfd
+10
View File
@@ -253,6 +253,16 @@ impl TextArea {
} if modifiers == (KeyModifiers::CONTROL | KeyModifiers::ALT) => {
self.delete_backward_word()
},
KeyEvent {
code: KeyCode::Backspace,
modifiers: KeyModifiers::CONTROL,
..
} => {
// Map Ctrl+Backspace to delete the entire current line contents.
// This provides a portable shortcut similar to macOS Cmd+Backspace
// for terminals that do not forward the Command (SUPER) modifier.
self.delete_entire_line();
}
KeyEvent {
code: KeyCode::Backspace,
modifiers: KeyModifiers::ALT,