nvm ls
outputs color codes when piped to another command
#2497
Labels
bugs
Oh no, something's broken :-(
pull request wanted
This is a great way to contribute! Help us out :-D
Operating system and version: macOS 10.14.6 (18G8022)
nvm debug
output:nvm ls
output:How did you install
nvm
?Homebrew
What steps did you perform?
nvm ls | pbcopy
What happened?
All the ANSI codes were copied to the clipboard, as you can see from the section above.
What did you expect to happen?
nvm ls
should omit ANSI colour codes and outputs plain text when being piped to another command. This is in line with how other colour-using commands work, so would be generally expected behaviour. Having to add--no-colors
each time is a workaround, but it does not mirror the behaviour of other commands, which do the right thing automatically.Perhaps the default behaviour could be to use colours when outputting to a TTY, and no colours when not outputting to a TTY, and adding a new
--colors
flag which could be used to force the issue when colours are required in a pipe?Is there anything in any of your profile files that modifies the
PATH
?Yes; they all execute after
eval "$(nodenv init -)"
, which is at the top of the file.The text was updated successfully, but these errors were encountered: