console-rs / console-rs/console

Helper function for slicing strings with ansi codes in them.

Open
#135 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
144
Avg merge
8h 24m
Merged PRs (30d)
4

Description

The library currently has helper functions for stripping escape codes, and measuring string length with them removed.

It would be useful to have a helper function which can break up a string, inserting escape codes to terminate and resume the styling. This would in particular be useful for multi-line strings being formatted into columned outputs. Like I am trying to do here: https://github.com/Nukesor/comfy-table/issues/91

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing helpers for stripping ANSI escape codes and measuring visible string length. Review the related comfy-table issue for the column-formatting use case, then define how slicing should preserve styling across breaks and multiline output. Done means the helper handles styled strings without corrupting their escape codes and has coverage for the intended cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.