ansi

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ansi strips terminal escape sequences from captured agent output.

It is its own package because both the process runner (stripping collected stdout) and the transcript recorder (stripping a decoded stream event's text) need it, and the recorder runs in packages that must not depend on the runner's process-execution and telemetry machinery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Strip

func Strip(b []byte) []byte

Strip removes ANSI terminal escape sequences from b: CSI sequences (colors and cursor movement, "\x1b[31m"), OSC sequences (window titles and hyperlinks, terminated by BEL or ST), and the remaining ESC-prefixed forms (charset designations, "\x1b(B"). It covers what agent CLIs and the tools they shell out to actually emit; it is not a full terminal emulator.

Callers stripping JSON stream output must strip the DECODED text of an event, not the raw line: there a tool's escapes sit backslash-u escaped inside a JSON string, where this is a no-op.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL