question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggestion] Wrapper for effects and unprintable characters

See original GitHub issue

Hello.

I created a Pull request a few minutes ago adding a “wrapper” feature.

I’m working on an Open Source tool to setting the PS1 in your terminal, using node. But for that, I needed all the colours and effects to be wrapped into \[ and \].

I figured this could be an interesting addition for the chalk project as it can be used to “tokenise” the styles, to identify and debug them, or help you out on different TTYs.

I hope this can be considered 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Qix-commented, Jun 11, 2018

Hey - not really interested to be quite honest. Just do a search for \x1b and replace it with a character of your choosing (or remove it entirely) in the output.

For example,

$ FORCE_COLOR=1 node your/chalk/app.js | tr -d "$(printf '\x1b')"
image
0reactions
Qix-commented, Mar 9, 2019

That means your terminal emulator doesn’t support them and is improperly reporting its TERM variable. Which one are you using?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Re: How can I remove non-printable characters from...
Any suggestion to keep the spacing between words and at the same remove the unwanted characters. I used purgechar(Address, ' ') as Address1...
Read more >
Non Printable & Special Characters: Problems and how to ...
ABSTRACT. Non printable & special characters in clinical trial data create potential problems in producing quality deliverables.
Read more >
How to use Unicode controls for bidi text - W3C
View code. A tooltip with control characters. To achieve the correct effect we add the two invisible control characters, U+202B RIGHT-TO-LEFT ...
Read more >
Controls and properties in canvas apps - Microsoft Learn
In this article. Controls; Common properties by category; All properties. Configure the appearance and behavior of a control by setting one ...
Read more >
Funny ^Stuff~ in My Code – Using ODS ESCAPECHAR
Line break, line wrap, non-breaking space, and other special codes. Inserts generally unprintable characters into the cell or inserts characters which may be....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found