Skip to content

Fix/border calculation when --color is on#3

Open
eclizs wants to merge 2 commits intoGishankrishka:mainfrom
eclizs:fix/border-color-support
Open

Fix/border calculation when --color is on#3
eclizs wants to merge 2 commits intoGishankrishka:mainfrom
eclizs:fix/border-color-support

Conversation

@eclizs
Copy link
Copy Markdown

@eclizs eclizs commented May 3, 2026

Beforehand, this code below calculated the whole string including the ANSI codes.

len(result[0][1::-1])

I fixed the calculation by using re.sub() of result[0] and replacing the ANSI codes with an empty string. Here is the regex pattern:

r"\x1b\[[0-9;*]+m"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant