medikoo / cli-color

Colors and formatting for the console
ISC License
676 stars 34 forks source link

Reset #4

Closed stevenbeeckman closed 12 years ago

stevenbeeckman commented 12 years ago

Hi,

console.log(clc.bgBright.bgBlack.red(req.method + " " + req.url + ": notFound()") );

doesn't reset its background. Subsequent console.log() calls also have the bgBright.bgBlack background.

My current work-around: append \033[0m to the end of the console.log() call.

medikoo commented 12 years ago

Sorry for late response, github after latest notifcation changes decided to notify me of new issues only via RSS feed ;-)

Anyway, I'm not able to reproduce that, and it definitely shouldn't behave like that. Can you provide more details about your environment: Node.js version, system you are using, and cli-color version (is it the latest?). Thanks!

stevenbeeckman commented 12 years ago

cli-color version 0.1.7 on node.js version 0.6.19 on Windows Vista 64-bit (sorry :))

On Thu, Sep 13, 2012 at 11:19 PM, Mariusz Nowak notifications@github.comwrote:

Sorry for late response, github after latest notifcation changes decided to notify me of new issues only via RSS feed ;-)

Anyway, I'm not able to reproduce that, and it definitely shouldn't behave like that. Can you provide more details about your environment: Node.js version, system you are using, and cli-color version (is it the latest?). Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/medikoo/cli-color/issues/4#issuecomment-8543962.

medikoo commented 12 years ago

I investigated that, and it looks that it's Node issue. Windows shell doesn't support ANSI colors by default, they're translated by Node into something that Windows shell understands, and that translator for some reason fails to reset background color when it's set as bright variant.

I've opened issue for that https://github.com/joyent/node/issues/4019 Let's see what Node folks say.

It all works well in *nix environment, so I suggest until we'll figure out a fix, use hack with 0 code as you explained. I cannot take this hack into cli-color now, as it resets everything to default, so it may not play well for some cases.

Thanks!

medikoo commented 12 years ago

..and it's now fixed in Node master, so I assume in v0.8.10, it will work ok :)

stevenbeeckman commented 12 years ago

I'll upgrade Node then. Thanks!

Sent from a mobile device.

-----Original Message----- From: Mariusz Nowak notifications@github.com Date: Fri, 14 Sep 2012 09:37:40 To: medikoo/cli-colorcli-color@noreply.github.com Reply-To: medikoo/cli-color reply@reply.github.com Cc: stevenbeeckmansteven.beeckman+github@gmail.com Subject: Re: [cli-color] Reset (#4)

...and it's now fixed in Node master, so I assume in v0.8.10, it will work ok :)


Reply to this email directly or view it on GitHub: https://github.com/medikoo/cli-color/issues/4#issuecomment-8567265