fix: add ctrl+h as alternative backspace key for better terminal compatibility

- Some terminals send ctrl+h instead of backspace
- Added ctrl+h handling in settings.go and input.go
- Ensures backspace works in all terminal emulators
This commit is contained in:
2025-11-07 10:04:17 +00:00
parent b685a8afc7
commit 6058971a73
4 changed files with 2 additions and 2 deletions

BIN
dbbackup

Binary file not shown.

BIN
dbbackup_linux_amd64 Executable file

Binary file not shown.

View File

@ -71,7 +71,7 @@ func (m InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
return m, nil
case "backspace":
case "backspace", "ctrl+h":
if len(m.value) > 0 && m.cursor > 0 {
m.value = m.value[:m.cursor-1] + m.value[m.cursor:]
m.cursor--

View File

@ -353,7 +353,7 @@ func (m SettingsModel) handleEditingInput(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
case "enter":
return m.saveEditedValue()
case "backspace":
case "backspace", "ctrl+h":
if len(m.editingValue) > 0 {
m.editingValue = m.editingValue[:len(m.editingValue)-1]
}