Giter Site home page Giter Site logo

ANSI escape codes bug about debug HOT 11 CLOSED

debug-js avatar debug-js commented on May 8, 2024
ANSI escape codes bug

from debug.

Comments (11)

TooTallNate avatar TooTallNate commented on May 8, 2024

I'm not sure if this defensive output is necessary. On top of the \x... string syntax doesn't work with strict mode, so what we have right now seems just fine to me. Thanks for the suggestion, but closing.

from debug.

danielchatfield avatar danielchatfield commented on May 8, 2024

On top of the \x... string syntax doesn't work with strict mode, so what we have right now seems just fine to me.

The \x syntax does work with strict mode, what you currently have (octals) does not (another reason to change to this syntax).

from debug.

danielchatfield avatar danielchatfield commented on May 8, 2024

The bug that I was initially describing has since been fixed (the current code is slightly different) but as per my comment above you are mistaken about what will and won't work in strict mode.

from debug.

TooTallNate avatar TooTallNate commented on May 8, 2024

@danielchatfield I think we're both partially right (and wrong). Both /u0001 and \x01 syntax work fine in strict mode.

It's \251 syntax that doesn't work :)

from debug.

TooTallNate avatar TooTallNate commented on May 8, 2024

http://jslinterrors.com/dont-use-octal-a-use-instead

from debug.

TooTallNate avatar TooTallNate commented on May 8, 2024

But considering that the \u0001 syntax is what Node.js itself is using, I think I'm not gonna change it at this point.

from debug.

danielchatfield avatar danielchatfield commented on May 8, 2024

👍

from debug.

matthewmueller avatar matthewmueller commented on May 8, 2024

We just came across something that doesn't implement \u001b[9: https://papertrailapp.com/ :-D

Any chance we could switch this to the standard coloring?

from debug.

TooTallNate avatar TooTallNate commented on May 8, 2024

It should be literally the same bytes being written to the socket though. What is the standard coding you speak of?

from debug.

matthewmueller avatar matthewmueller commented on May 8, 2024

Oh hmm... Haven't looked too much into it, but I was referring to @danielchatfield's original post:

Since the 9c codes aren't actually standard (I haven't come across something which doesn't implement them though) it is understandable to include the equivalent 3c code before the 9c one as if the 'Intense' colour spec hasn't been implemented then it will display the 'non-intense' version instead

from debug.

danielchatfield avatar danielchatfield commented on May 8, 2024

If you look at the "SGR (Select Graphic Rendition) parameters" section of https://en.wikipedia.org/wiki/ANSI_escape_code you can see that the 90-97 parameters are not standard and some things (e.g. papertrailapp) have not implemented them. It is thus sensible to do the following:

[standard colour (30-37)][high intensity colour(90-97)]text[reset]

So that if something doesn't support the 90-97 parameters it will still be coloured but with the non-intense version.

from debug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.