Version0.16.0Verifiednot yet verifiedLicenseBSD-3-Clause

sigil-ansi

Terminal colors and formatting for Sigil

Report a bug or suggest a feature
Readme

sigil-ansi

ANSI terminal color and formatting library for Sigil.

Provides ANSI escape codes for terminal colors and text formatting. All functions are prefixed with a: to avoid naming conflicts.

Usage

(import (sigil ansi))

(display (a:green "PASS"))
(display (a:bold (a:red "FAIL")))
(display (a:dim "at test.sgl:42"))

Styles compose by nesting:

(display (a:bold (a:underline (a:cyan "Important"))))

Cursor and screen control:

(display (a:clear-screen))
(display (a:cursor-position 10 20))

Disable color globally for non-TTY output:

(with-ansi-disabled
  (lambda ()
    (display (a:red "no color here"))))

API

SurfaceFunctions
Foreground colorsa:black a:red a:green a:yellow a:blue a:magenta a:cyan a:white (+ a:bright-* variants)
Background colorsa:bg-black a:bg-red a:bg-green a:bg-yellow a:bg-blue a:bg-magenta a:bg-cyan a:bg-white
Stylesa:bold a:dim a:italic a:underline a:blink a:inverse a:hidden a:strikethrough
Reseta:reset
Cursora:clear-screen a:clear-line a:cursor-up a:cursor-down a:cursor-forward a:cursor-back a:cursor-home a:cursor-position a:hide-cursor a:show-cursor a:save-cursor a:restore-cursor
Utilitiesstrip-ansi ansi-enabled? with-ansi-disabled

Build & Test

sigil deps install
sigil test

License

BSD-3-Clause. See package.sgl for authors.

Clone

$ git clone https://codeberg.org/sigil/sigil-ansi

Releases

v0.16.0 — latest by version, released 6 May 2026

All releases — 3 tags in this repository.

Source

Browse the latest source

One page per file, and every line has a permalink.

Recent commitsAtom

The last 20 commits keep a page here. Everything older lives in the clone.