chore: style the machine reset prompt in red and fix the padding for [y/N]

This commit is contained in:
Pasha Sviderski
2026-04-22 19:00:38 +10:00
parent d340659370
commit 7b554cd703
2 changed files with 16 additions and 7 deletions
+9
View File
@@ -42,6 +42,15 @@ func ThemeConfirm() huh.Theme {
})
}
// ThemeConfirmDanger returns a huh theme with a bold red title style for dangerous confirmation prompts.
func ThemeConfirmDanger() huh.Theme {
return huh.ThemeFunc(func(isDark bool) *huh.Styles {
t := huh.ThemeBase(isDark)
t.Focused.Title = t.Focused.Title.Foreground(lipgloss.Red).Bold(true)
return t
})
}
// IsStdinTerminal checks if the standard input is a terminal (TTY).
func IsStdinTerminal() bool {
return term.IsTerminal(int(os.Stdin.Fd()))