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:
BIN
dbbackup_linux_amd64
Executable file
BIN
dbbackup_linux_amd64
Executable file
Binary file not shown.
@ -71,7 +71,7 @@ func (m InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
|
|
||||||
case "backspace":
|
case "backspace", "ctrl+h":
|
||||||
if len(m.value) > 0 && m.cursor > 0 {
|
if len(m.value) > 0 && m.cursor > 0 {
|
||||||
m.value = m.value[:m.cursor-1] + m.value[m.cursor:]
|
m.value = m.value[:m.cursor-1] + m.value[m.cursor:]
|
||||||
m.cursor--
|
m.cursor--
|
||||||
|
|||||||
@ -353,7 +353,7 @@ func (m SettingsModel) handleEditingInput(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
|||||||
case "enter":
|
case "enter":
|
||||||
return m.saveEditedValue()
|
return m.saveEditedValue()
|
||||||
|
|
||||||
case "backspace":
|
case "backspace", "ctrl+h":
|
||||||
if len(m.editingValue) > 0 {
|
if len(m.editingValue) > 0 {
|
||||||
m.editingValue = m.editingValue[:len(m.editingValue)-1]
|
m.editingValue = m.editingValue[:len(m.editingValue)-1]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user