-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to version of cliui that handles ansi-colors #277
Conversation
Found a small problem concerning option alignment when ANSI colors are used in a description for an option. Commit 9963cbd adds 2 tests to demonstrate this with a minimal example:
As is, the 1st test passes but the 2nd test fails. Not sure what the root problem is, will need to investigate later. |
FYI the test comes from an example I put together in issue 251. Here's what the problem looks like: |
This is my before and after runs from gulp: BeforeAfterAs you can see, the wrapping colors now work correctly. I'm not sure what the result of the types column should look like though. Thanks for all the work on this @bcoe! |
@phated, @nexdrew sorry for being slow to update it's been a busy few weeks (I also apologize for how much of a bikeshed 🚲 🏠 this is at this point, want to make sure we solve this issue for good). I've made some changes to how widths are calculated for ansi escape codes, @phated your right-hand-column should align |
Looks good! Thanks @bcoe for all the work you have been putting into this! |
upgrade to version of cliui that handles ansi-colors
|
@nexdrew your sure this is a yargonaut bug, and not something we can fix in cliui or yargs (while we're tearing these libraries apart any ways). |
@bcoe Well, I think cliui might be unnecessarily trimming leading whitespace when ANSI colors are used. See yargonaut issue 7 for example. Was planning to look into it and offer a fix, if necessary. Unfortunately I am AFK at the moment and won't have a chance to look til later tonight or tomorrow. |
I've updated the layout logic in cliui to take into account the ansi escape codes:
yargs/cliui#11
yargs/cliui#12