feat: Task 16 — SSH Session Tab (multi-session)

- pkg/tui/session.go — SessionTab with live SSH terminal in a tab
- pkg/tui/messages.go — quitMsg, openSessionMsg, sessionOutputMsg
- pkg/tui/tabs.go — Tab.Close() interface, Add() returns tea.Cmd
- pkg/tui/host_list_tab.go — Enter opens session tab, q quits
- pkg/tui/tui.go — handle openSessionMsg/quitMsg, SetDataDir
- cmd/hostkeeper/tui.go — pass dataDir to model
This commit is contained in:
swanadiva
2026-06-23 14:54:44 +07:00
parent 5d9e38f8db
commit 98dfc1c79c
6 changed files with 432 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
package tui
import "git.tukangketik.id/swanadiva/hostkeeper/internal/models"
// quitMsg signals the TUI to exit
type quitMsg struct{}
// openSessionMsg signals the TUI to open a new SSH session tab
type openSessionMsg struct {
host *models.Host
dataDir string
}
// sessionOutputMsg carries SSH output to the TUI renderer
type sessionOutputMsg string
// sessionDoneMsg signals that a session has ended
type sessionDoneMsg struct {
err error
}