Documentation
¶
Index ¶
- Constants
- Variables
- func ClearLines(n int)
- func Confirm(message string, defaultYes bool) bool
- func Error(format string, args ...any)
- func Header(text string)
- func Info(format string, args ...any)
- func IsTTY() bool
- func PrintCTA(cmds ...string)
- func PrintCdHint(path string)
- func Success(format string, args ...any)
- func Truncate(s string, max int) string
- func Warn(format string, args ...any)
- type Spinner
Constants ¶
const ( Current = "●" Pending = "◐" Pass = "✓" Fail = "✗" ArrowDown = "⇣" ArrowUp = "⇡" PushUp = "⬆" Dash = "—" NoReview = "○" ErrorMark = "✗" )
Glyphs used throughout the UI.
Variables ¶
var ( Green = color.New(color.FgGreen).SprintFunc() Yellow = color.New(color.FgYellow).SprintFunc() Red = color.New(color.FgRed).SprintFunc() Blue = color.New(color.FgBlue).SprintFunc() Cyan = color.New(color.FgCyan).SprintFunc() Magenta = color.New(color.FgMagenta).SprintFunc() Dim = color.New(color.FgHiBlack).SprintFunc() Bold = color.New(color.Bold).SprintFunc() GreenF = color.New(color.FgGreen).PrintfFunc() YellowF = color.New(color.FgYellow).PrintfFunc() BlueF = color.New(color.FgBlue).PrintfFunc() CyanF = color.New(color.FgCyan).PrintfFunc() DimF = color.New(color.FgHiBlack).PrintfFunc() )
Color shortcuts — matches the fish script's set_color calls.
Functions ¶
func ClearLines ¶ added in v1.3.0
func ClearLines(n int)
ClearLines moves the cursor up n lines and clears each one. Used by wt watch to redraw the live status table in-place. No-op when stdout is not a terminal.
func Confirm ¶
Confirm prompts the user with a y/n question. defaultYes: if true, pressing Enter means yes (Y/n); if false, means no (y/N).
func IsTTY ¶ added in v1.6.0
func IsTTY() bool
IsTTY reports whether stdout is connected to a terminal.
func PrintCTA ¶ added in v1.12.0
func PrintCTA(cmds ...string)
PrintCTA prints machine-readable call-to-action suggestions for agent consumers. Only emits output when stdout is not a TTY — human terminal output is unaffected. Format: "cta: cmd1 | cmd2"
func PrintCdHint ¶
func PrintCdHint(path string)
PrintCdHint tells the shell wrapper to cd into the given path. When WT_CD_FILE is set (by the shell wrapper), writes the path to that file. Otherwise prints a hint so the user knows to cd manually.
Types ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner shows an animated wave indicator for long-running operations. The animation uses block element characters rendered as a 3-bar equalizer.
func NewSpinner ¶
NewSpinner starts an animated spinner with the given message (auto-dimmed). Call Stop() to clear the spinner line and release resources.
func NewSpinnerRich ¶
NewSpinnerRich starts a spinner that renders the message as-is, without wrapping it in Dim. Use this when the message contains its own ANSI colors.