Skip to content
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

Consider utils for colored strings #92

Open
pskfyi opened this issue May 26, 2023 · 0 comments
Open

Consider utils for colored strings #92

pskfyi opened this issue May 26, 2023 · 0 comments
Assignees
Labels
⚡️ effort:low enhancement New feature or request 🌶️ spicy Seems exciting to work on 🙏 wanted We have a use case for this
Milestone

Comments

@pskfyi
Copy link
Owner

pskfyi commented May 26, 2023

The Deno standard library provides color functions, which wrap strings in ANSI color codes, resulting in the strings appearing as various colors in the console. This has some rough edges, in particular around string length which is augmented by the color codes but not visible, making it easy to become confused and introduce errors.

We should consider something like a FormattedString class which wraps the desired abilities, but could expose common string properties like length with respect to the original input string. This would be useful in evalCodeBlocks and upcoming Cursor functions, but could also widely be used in Deno.customInspect functions to customize console log output for all scripts or classes.

@pskfyi pskfyi added the enhancement New feature or request label May 26, 2023
@pskfyi pskfyi added 🌶️ spicy Seems exciting to work on 🙏 wanted We have a use case for this ⚡️ effort:low labels Jun 8, 2023
@pskfyi pskfyi added this to the 0.5.0 milestone Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡️ effort:low enhancement New feature or request 🌶️ spicy Seems exciting to work on 🙏 wanted We have a use case for this
Projects
None yet
Development

No branches or pull requests

2 participants