Sunday, January 12

Sequin: An effective little tool for examining ANSI escape series

videobacks.net

Human-readable ANSI .

Sequin is little that can assist you debug your CLIs and TUIs. It' likewise excellent for explaining series you not comprehend, and exploring what TUIs are doing hood.

There are lots more utilize too, like checking such as the ones utilized by teatest to crystalize .

Are you utilizing Sequin in a fascinating ? enjoy to find out about it.

Utilize a plan supervisor:

# macOS or Linux brew set up charmbracelet/tap/sequin # Arch Linux (btw) yay -S sequin-bin # Nix nix-shell -p nur.repos.charmbracelet.sequin Debian/Ubuntu sudo mkdir -p/ etc/apt/keyrings curl -fsSL https://repo.charm.sh/apt/gpg.key|sudo gpg– dearmor -o/ etc/apt/keyrings/ charm.gpg echo “deborah [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *”|sudo tee/ etc/apt/sources. list.d/ charm.list sudo apt upgrade && & & sudo apt set up sequin Fedora/RHEL echo'[charm]
name=Charm baseurl=https://repo.charm.sh/yum/ made it possible for=1 gpgcheck=1 gpgkey=https://repo.charm.sh/yum/gpg.key'|sudo tee/ etc/yum. repos.d/ charm.repo sudo yum set up sequin

Or, it:

  • Plans are readily available in and RPM
  • Binaries are readily available for , macOS, , FreeBSD, OpenBSD, and NetBSD

Or, simply install it with go:

go up /charmbracelet/sequin@latest Shell Completions

the bundles and featured -generated conclusion declare Bash, ZSH, , and PowerShell.

If you constructed it from source, you can create them with:

sequin conclusion - sequin conclusion zsh -h sequin conclusion fish -h sequin conclusion powershell -h

If you utilize a bundle (like Homebrew, Debs, and so ), the conclusions must be instantly, offered your shell is set up appropriately.

Examples

Explaining escape series

Simply utilize printf to send out some series to sequin for a description.

printf ” x1b[38;5;4mCiaox1b[1;7mBaby.x1b[0mn”|sequin

the output of a

You can likewise utilize it to examine the output of any program, for example, ls or git.

ls -1– =constantly|sequin

git -c .color=constantly status -sb|sequin

Yeah, it's fantastic for debugging , and of , finding out about ANSI!

in

Numerous render their output as plain when output isn' a (.e. when rerouting to a file or piping to a program, like sequin). This is a good , other than in this when we really desire ANSI series so we can them. Luckily there are generally methods to require , like by CLICOLOR_FORCE=1 or with to require ANSI output. If you're not seeing series sure to examine what operate in the case of your particular program.

Taking a look at golden files

Golden apply for TUIs consist of ANSI, which can be quickly checked with sequin:

$ ./ testdata/MyCuteApp. golden|sequin

To produce golden apply for your TUIs take a look at golden and teatest from the/ task.

ยป …
Find out more

videobacks.net