7b06793002
Phase A — Tamagosh-inspired redesign: - Replace goroutine-based SSH (crypto/ssh) with tea.ExecProcess + native ssh binary - Zero-lag SSH: native binary pegang TTY langsung, ga ada Go buffering - Password auth via sshpass -e (SSHPASS env) - Key auth via ssh -i <tmpfile> + SSH_ASKPASS for passphrase - ControlMaster sockets for fast reconnect - Add askpass subcommand for SSH_ASKPASS support - Gruvbox Material Dark Hard palette for comfortable viewing - Clean up old session messages (openSessionMsg, sessionOutputMsg, sessionDoneMsg) - Remove 354-line session.go, replace with 150-line ssh.go
48 lines
2.2 KiB
Go
48 lines
2.2 KiB
Go
package tui
|
|
|
|
import "github.com/charmbracelet/lipgloss"
|
|
|
|
// Gruvbox Material Dark Hard palette — warm, soft, easy on eyes
|
|
var (
|
|
gbFg = lipgloss.Color("#d4be98") // primary text
|
|
gbFgMute = lipgloss.Color("#7c6f64") // secondary/hints
|
|
gbBgSel = lipgloss.Color("#45403d") // cursor row bg
|
|
gbRed = lipgloss.Color("#ea6962") // error/destructive
|
|
gbOrange = lipgloss.Color("#e78a4e") // section headers
|
|
gbYellow = lipgloss.Color("#d8a657") // accent/titles
|
|
gbGreen = lipgloss.Color("#a9b665") // active pane/success
|
|
gbAqua = lipgloss.Color("#89b482") // interactive keys
|
|
gbBlue = lipgloss.Color("#7daea3")
|
|
gbPurple = lipgloss.Color("#d3869b")
|
|
gbBorder = lipgloss.Color("#504945") // subtle border
|
|
)
|
|
|
|
// Component styles
|
|
var (
|
|
TabActiveStyle = lipgloss.NewStyle().Background(gbYellow).Foreground(lipgloss.Color("#1d2021")).Bold(true).Padding(0, 2)
|
|
TabInactiveStyle = lipgloss.NewStyle().Background(gbBorder).Foreground(gbFgMute).Padding(0, 2)
|
|
TabBarStyle = lipgloss.NewStyle().Background(lipgloss.Color("#1d2021"))
|
|
StatusBarStyle = lipgloss.NewStyle().Background(gbGreen).Foreground(lipgloss.Color("#1d2021")).Padding(0, 1)
|
|
AppTitleStyle = lipgloss.NewStyle().Foreground(gbYellow).Bold(true)
|
|
HighlightStyle = lipgloss.NewStyle().Foreground(gbOrange).Bold(true)
|
|
SelectedStyle = lipgloss.NewStyle().Foreground(gbFg).Background(gbBgSel).Bold(true).Padding(0, 1)
|
|
ErrorStyle = lipgloss.NewStyle().Foreground(gbRed).Bold(true)
|
|
SuccessStyle = lipgloss.NewStyle().Foreground(gbGreen).Bold(true)
|
|
InfoStyle = lipgloss.NewStyle().Foreground(gbAqua)
|
|
SubtitleStyle = lipgloss.NewStyle().Foreground(gbFgMute)
|
|
HostNameStyle = lipgloss.NewStyle().Foreground(gbYellow).Bold(true)
|
|
HostDetailStyle = lipgloss.NewStyle().Foreground(gbFgMute)
|
|
TagStyle = lipgloss.NewStyle().Foreground(gbGreen)
|
|
TitleStyle = AppTitleStyle
|
|
SectionStyle = lipgloss.NewStyle().Foreground(gbOrange).Bold(true)
|
|
BorderStyle = lipgloss.NewStyle().Border(lipgloss.RoundedBorder()).BorderForeground(gbBorder).Padding(1, 2)
|
|
)
|
|
|
|
// TabWidth returns the width of the tab bar content
|
|
func TabBarWidth(totalWidth int) int {
|
|
if totalWidth < 10 {
|
|
return totalWidth
|
|
}
|
|
return totalWidth - 2
|
|
}
|