mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:23:33 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user