Terminal Styling
Text Styling
Individual Style Functions
These wrap text in ANSI escape codes and return the styled string.
Modifiers: term/bold, term/dim, term/italic, term/underline, term/inverse, term/strikethrough
Colors: term/black, term/red, term/green, term/yellow, term/blue, term/magenta, term/cyan, term/white, term/gray
(term/bold "important") ; => bold text
(term/red "error") ; => red text
(println (term/green "success"))term/style
Apply multiple styles at once using keywords.
(term/style "warning" :bold :yellow)
(term/style "error" :bold :red :underline)Available keywords: :bold, :dim, :italic, :underline, :inverse, :strikethrough, :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white, :gray
term/rgb
Apply 24-bit true color to text. Takes text, red, green, blue (0-255).
(term/rgb "custom color" 255 128 0) ; => orange textterm/strip
Remove ANSI escape sequences from a string.
(term/strip (term/bold "hello")) ; => "hello"Spinners
Animated terminal spinners for long-running operations.
term/spinner-start
Start a spinner with a message. Returns a spinner ID.
(define id (term/spinner-start "Processing..."))term/spinner-update
Update the spinner message while it's running.
(term/spinner-update id "Still processing...")term/spinner-stop
Stop a spinner. Optionally show a final status.
(term/spinner-stop id)
;; With final status
(term/spinner-stop id {:symbol "✔" :text "Done"})