Skip to content

feat(utils): add function to strip ansi sequences#195

Merged
Tieske merged 1 commit intomainfrom
feat/stripansi
Feb 10, 2026
Merged

feat(utils): add function to strip ansi sequences#195
Tieske merged 1 commit intomainfrom
feat/stripansi

Conversation

@Tieske
Copy link
Member

@Tieske Tieske commented Feb 10, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a utility for removing terminal ANSI escape sequences from strings so downstream formatting/width logic can operate on plain text.

Changes:

  • Introduce terminal.utils.strip_ansi(str) to remove ANSI escape/control sequences from strings.
  • Add Busted specs validating strip_ansi() behavior for common ANSI patterns (SGR/CSI/OSC/C1 CSI).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/terminal/utils.lua Adds M.strip_ansi() implementation and LuaDoc describing intended coverage.
spec/00-utils_spec.lua Adds unit tests for strip_ansi() across several common ANSI sequence types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tieske Tieske merged commit 8767a27 into main Feb 10, 2026
17 checks passed
@Tieske Tieske deleted the feat/stripansi branch February 10, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants