Skip to content

Conversation

CircuitCoder
Copy link

This allows using ANSI escape codes in select items.

Previously line width are measured using str::len, which causes text with ANSI escape codes to be measured longer than they really are. Subsequently when clearing printed lines, additional lines can be cleared.

@pksunkara
Copy link
Collaborator

I would prefer if we integrate https://github.com/mgeisler/textwrap. That library is very high quality (I can attest to) and is being used in clap, and we personally don't need to maintain this text_width related logic.

@CircuitCoder
Copy link
Author

OK I'll look into that when I have some time.

Right now, the measured width is only used for clearing printed lines in select/sort/mult_select. If we switch to textwrap, are we going to change the way we render the options too?

@pksunkara
Copy link
Collaborator

Yeah, we need to handle multi-lines text anyway normally.

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.

2 participants