fix: use line numbers to prevent deleting all duplicate SSH hosts when removing one

This commit is contained in:
2026-01-04 21:34:09 +01:00
parent def2b4fa8d
commit 8f780e288c
4 changed files with 71 additions and 25 deletions

View File

@@ -144,7 +144,11 @@ func (m Model) renderListView() string {
func (m Model) renderDeleteConfirmation() string {
// Remove emojis (uncertain width depending on terminal) to stabilize the frame
title := "DELETE SSH HOST"
question := fmt.Sprintf("Are you sure you want to delete host '%s'?", m.deleteHost)
hostName := ""
if m.deleteHost != nil {
hostName = m.deleteHost.Name
}
question := fmt.Sprintf("Are you sure you want to delete host '%s'?", hostName)
action := "This action cannot be undone."
help := "Enter: confirm • Esc: cancel"