nvm icon indicating copy to clipboard operation
nvm copied to clipboard

Disable colors when stdout is not a terminal.

Open heinthanth opened this issue 4 years ago • 7 comments

Fixes #2497

heinthanth avatar Oct 18 '21 14:10 heinthanth

Can someone review this … ?

heinthanth avatar Oct 19 '21 16:10 heinthanth

It looks good, but there's a bunch of tests failing.

ljharb avatar Oct 19 '21 19:10 ljharb

Failure on WSL is a failure from action itself.

Failure on travis is quite interesting. But I didn't changed any core codes. I just used --no-colors arguments ( forcibly set if stdout is not a terminal ). I think travis must fail too ( when using --no-colors )

Edit: some errors are confusing ... What's *

'nvm alias default did not return 'default -> 0.10.1 (-> v0.10.1)', got 'default -> 0.10.1 (-> v0.10.1 *)'

Edit: tested on local machine

@ljharb, I think ... travis use | to capture stdout. But using pipe cause stdout is not a terminal. So that, output has *.

It's the same with original nvm using --no-colors. I think we need to update travis scripts Or we'll have to use another method to disable colors.

Screen Shot 2021-10-20 at 12 44 43 PM

heinthanth avatar Oct 20 '21 06:10 heinthanth

When colors are disabled, nvm uses symbols, instead of colors, to convey information.

In other words, there may be tests that are expecting the color output, and this change means those tests need to be updated.

ljharb avatar Oct 20 '21 06:10 ljharb

Correcciones nvm-sh/nvm

jorgeluisrdz16 avatar Nov 02 '21 01:11 jorgeluisrdz16

All the "fast" and "sourcing" tests are failing.

ljharb avatar Nov 04 '21 05:11 ljharb

Fixes nvm-sh/nvm#2497

jorgeluisrdz16 avatar Nov 07 '21 14:11 jorgeluisrdz16