GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — added CSI (\x9b) as additionally allowable escape by Qix- · Pull Request #2521 · nodejs/node

Conversation

@Qix-

@Qix- Qix- commented Aug 24, 2015

Copy link
Copy Markdown

Added \x9b as an additionally allowable ANSI escape code. It's pretty phased out, but can still be used.

The difference between the two is that \x1b requires a following [. Together, both of those characters combined form the CSI. There is the single character alternative, \x9b, that doesn't require the [. It is less common, I speculate, because faulty ANSI implementations will output [37;1m which is more distinct than just 37;1m - don't quote me on that though. All I know is that it has to do with C0 and C1 control codes and a bunch of unicode voodoo.

I doubt many terminal emulators even support it nowadays but it is something you should probably be checking for and should be innocuous to those not using it.

Brought to my attention from chalk/ansi-regex#5 cc @sindresorhus

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ChALkeR ChALkeR added the readline Issues and PRs related to the built-in readline module. label Aug 24, 2015
@Fishrock123

Fishrock123 commented Aug 24, 2015

Copy link
Copy Markdown
Contributor

I think you'd also need to add it on lines such as this? https://github.com/nodejs/node/pull/2521/files#diff-d2acee21faac11dc676c3e4570bad979R998

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Aug 24, 2015

Copy link
Copy Markdown
Author

You're correct. Will update here in a bit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-
added CSI (\x9b) as additionally allowable escape
4bb27d7
Added `\x9b` as an additionally allowable ANSI escape code. It's pretty phased out, but can still be used.

The difference between the two is that `\x1b` requires a following `[`. Together, both of those characters combined form the CSI. There is the single character alternative, `\x9b`, that doesn't require the `[`. It is less common, I speculate, because faulty ANSI implementations will output `[37;1m` which is more distinct than just `37;1m` - don't quote me on that though. All I know is that it has to do with [C0 and C1 control codes](https://en.wikipedia.org/wiki/C0_and_C1_control_codes) and a bunch of unicode voodoo.

I doubt many terminal emulators even support it nowadays but it *is* something you should probably be checking for.
@Qix-
Qix- force-pushed the patch-1 branch from 92cb40c to 4bb27d7 Compare August 24, 2015 16:35
@Qix-

Qix- commented Aug 24, 2015

Copy link
Copy Markdown
Author

@Fishrock123 done and done.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Sep 3, 2015

Copy link
Copy Markdown
Contributor

cc @rlidwka who has been around these parts recently.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg
rvagg force-pushed the master branch from 11c25c2 to ba02bd0 Compare September 6, 2015 11:55
@rlidwka

rlidwka commented Sep 6, 2015

Copy link
Copy Markdown
Contributor

I doubt many terminal emulators even support it nowadays

Can you name at least one so we can check it and reference it in the comments?

Also, if you're changing that generator, it'd be nice to add a test.

PS: I have a feeling that this PR adds \x9b[37;1m-like stuff only, where [ is required, which is contrary to what you described. Does the regexp work with \x9b37;1m? Should it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Sep 6, 2015

Copy link
Copy Markdown
Author

Can you name at least one so we can check it and reference it in the comments?

Well it's any ecma-48 compliant terminal. That means it has to support 8-bit sequences. Unfortunately, I can't find a specific list of one.

Also, if you're changing that generator, it'd be nice to add a test.

I can do that 💃

PS: I have a feeling that this PR adds \x9b[37;1m-like stuff only, where [ is required, which is contrary to what you described. Does the regexp work with \x9b37;1m? Should it?

Yes it should, good catch. Not sure why I didn't see that before. I'll make the appropriate edits and whatnot.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 16, 2015

Copy link
Copy Markdown
Member

@Qix- ... any updates on this one?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the stalled Issues and PRs manually marked as stalled and scheduled for automatic closure. label Nov 16, 2015
@Qix-

Qix- commented Nov 16, 2015

Copy link
Copy Markdown
Author

@jasnell would you be opposed to using ansi-regex? There has been a considerable amount of research and work put into it (check the tests). As it stands, making the current implementation of Node's regex complete would require quite a bit of rewriting.

I know the usage of modules is kind of a pain in a proper node release, but the module is pretty stable and hasn't had to be changed in quite a while. It is simple and could easily be used in a static manner.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 16, 2015

Copy link
Copy Markdown
Member

opposed to using it how?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Nov 16, 2015

Copy link
Copy Markdown
Author

In lieu of the existing regex strings that I attempted to update in this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 16, 2015

Copy link
Copy Markdown
Member

hmm... using the same regex would likely make sense but pulling that module into core might be problematic. Would love to get the thoughts of other @nodejs/ctc folks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Nov 16, 2015

Copy link
Copy Markdown
Author

cc @sindresorhus again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sindresorhus

sindresorhus commented Nov 17, 2015

Copy link
Copy Markdown

Feel free to take whatever from that module. Anything to make Node.js core better.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Nov 17, 2015

Copy link
Copy Markdown
Contributor

It's a single regex, I think it hardly qualifies as 'pulling a module in', so I'd say go ahead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 17, 2015

Copy link
Copy Markdown
Member

@sindresorhus ... appreciate it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott force-pushed the master branch from 1e896a6 to 082cc8d Compare December 27, 2015 02:00
@jasnell

jasnell commented Apr 22, 2016

Copy link
Copy Markdown
Member

@Qix- ... is this still something you'd like to do? If so, would you mind rebasing and updating this to perhaps use the regex from ansi-regex?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Apr 22, 2016

Copy link
Copy Markdown
Author

@jasnell is doing that approved? Since it wasn't ever officially stated as "yes, pull in the regex" I didn't bother continuing with anything.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 22, 2016

Copy link
Copy Markdown
Member

See #2521 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Apr 23, 2016

Copy link
Copy Markdown
Author

No I know, I mean is it approved by the Node.js team to use it ;) Referring to #2521 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 23, 2016

Copy link
Copy Markdown
Member

As long as @sindresorhus is credited and mention of it is added to our LICENSE file then it should be fine. Basically, just append the contents of https://github.com/chalk/ansi-regex/blob/master/license to https://github.com/nodejs/node/blob/master/LICENSE with a header indicating the source https://github.com/chalk/ansi-regex/. Then add a comment to the source crediting where the regex came from. If others from the @nodejs/ctc have concerns I'm sure they'll bring it up :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qix-

Qix- commented Apr 23, 2016

Copy link
Copy Markdown
Author

Hehe I'm also a collaborator on that repo as well and basically wrote what the regex is currently. IIRC (this is an old pull) Sindre was the one to suggest pulling in the regex since it's better tested anyway.

But yeah I can amend this PR :) Give me a little though!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 23, 2016

Copy link
Copy Markdown
Member

:-) ok, make sure to give yourself credit then! :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@estliberitas
estliberitas force-pushed the master branch 2 times, most recently from 7da4fd4 to c7066fb Compare April 26, 2016 05:22
@aliscco aliscco mentioned this pull request May 14, 2022
[Snyk] Security upgrade node-gyp from 7.1.2 to 8.4.1 aliscco/alisco-node#54
Open
@awaisab172 awaisab172 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities awaisab172/node#33
Open
@pratapadi pratapadi mentioned this pull request May 14, 2022
[Snyk] Security upgrade node-gyp from 7.1.2 to 8.4.1 pratapadi/node#17
Open
@ajesse11x ajesse11x mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities ajesse11x/node#36
Open
@wedataintelligence wedataintelligence mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities wedataintelligence/node#32
Open
@bumplzz69 bumplzz69 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities bumplzz69/node#36
Open
@erdun erdun mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities erdun/node#46
Open
@sirinartk sirinartk mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities sirinartk/node#32
Open
@Qdigital Qdigital mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities Qdigital/node#28
Open
@kaocher82 kaocher82 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities Xtuden-com/node#27
Open
@vaibhavb vaibhavb mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities vaibhavb/node#26
Open
@solebox solebox mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities solebox/node#30
Open
@apoorvanand apoorvanand mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities apoorvanand/node-2#26
Open
@terrorizer1980 terrorizer1980 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities terrorizer1980/node-1#10
Open
@snyk-bot snyk-bot mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities olegnn/node#39
Open
@molllyn1 molllyn1 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities molllyn1/node#47
Open
@AyushG3112 AyushG3112 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities AyushG3112/node#27
Open
@s4sc s4sc mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities s4sc/node#27
Open
@yotamselementor yotamselementor mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities yotamselementor/node#20
Open
@xphillyx xphillyx mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities xphillyx/node#14
Open
@AyushG3112 AyushG3112 mentioned this pull request Jun 22, 2022
[Snyk] Fix for 1 vulnerabilities AyushG3112/node#28
Open
@snyk-bot snyk-bot mentioned this pull request Jun 24, 2022
[Snyk] Fix for 7 vulnerabilities adamlaska/node#70
Open
@snyk-bot snyk-bot mentioned this pull request Sep 23, 2022
[Snyk] Fix for 2 vulnerabilities 137717unity/node#66
Open
@Verdinjoshua26 Verdinjoshua26 mentioned this pull request Sep 26, 2022
[Snyk] Fix for 9 vulnerabilities Verdinjoshua26/node#24
Open
This was referenced Sep 26, 2022
[Snyk] Fix for 2 vulnerabilities wedataintelligence/node#46
Open
[Snyk] Fix for 11 vulnerabilities vaibhavb/node#35
Open
@RoeeOren RoeeOren mentioned this pull request Oct 5, 2022
[Snyk] Fix for 9 vulnerabilities RoeeOren/node#32
Open
@MrBrain295 MrBrain295 mentioned this pull request Oct 5, 2022
[Snyk] Fix for 1 vulnerabilities MrBrain295/node#7
Open
@bumplzz69 bumplzz69 mentioned this pull request Oct 5, 2022
[Snyk] Fix for 11 vulnerabilities bumplzz69/node#39
Open
@snyk-bot snyk-bot mentioned this pull request Oct 9, 2022
[Snyk] Fix for 2 vulnerabilities Rednickle/node-1#62
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

readline Issues and PRs related to the built-in readline module. stalled Issues and PRs manually marked as stalled and scheduled for automatic closure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@Qix- @Fishrock123 @silverwind @rlidwka @jasnell @sindresorhus @trevnorris @ChALkeR
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.