fix: sshCmd closure bug + error display

CRITICAL BUG: sshConnectCmd wrapped tea.ExecProcess inside an extra
closure, so Bubble Tea never executed the SSH process — Enter appeared
to do nothing.

Fix:
- sshConnectCmd now returns tea.ExecProcess directly (no extra closure)
- tea.ExecProcess handles all process lifecycle (start, PTY, exit)
- sshExitMsg errors are shown in host list view (ErrorStyle)
- Error routed via Model.Error → HostListTab.err → View()
This commit is contained in:
swanadiva
2026-06-23 15:50:20 +07:00
parent 79f3917a66
commit daa20ac72b
3 changed files with 104 additions and 80 deletions
+7
View File
@@ -121,6 +121,13 @@ func (t *HostListTab) View() string {
var b strings.Builder
// Show error if any
if t.err != nil {
b.WriteString(ErrorStyle.Render(fmt.Sprintf(" Error: %v ", t.err)))
b.WriteString("\n")
t.err = nil
}
// Capped vertical padding
b.WriteString(strings.Repeat("\n", 2))