Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No fancy terminal features when stdout not a tty #728

Closed
hildjj opened this issue Oct 11, 2016 · 13 comments
Closed

No fancy terminal features when stdout not a tty #728

hildjj opened this issue Oct 11, 2016 · 13 comments

Comments

@hildjj
Copy link

hildjj commented Oct 11, 2016

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Color escape codes and progress bars are always output, regardless of whether stdout is a TTY.

If the current behavior is a bug, please provide the steps to reproduce.
To reproduce easily, yarn | more. Note the escape codes being printed literally.

What is the expected behavior?
When the output of yarn is redirected, do not use color escapes. Likely, the output is going to be processed in some way. Check process.stdout.isTTY() (see https://nodejs.org/api/tty.html#tty_tty for example), before outputting color, doing fancy spinners or progress bars.

Please mention your node.js, yarn and operating system version.
node.js: v6.7.0
yarn: 0.15.1
OS: OSX 10.12

@victornoel
Copy link
Contributor

+1 Also it would be great to have a command line option to force this behaviour :)

@brentjohnson
Copy link

--no-color possibly?

@sensedeep
Copy link

For CI, it would be great to have a really quiet option that emits trace only on failures (and without control codes).

yarn -q ...... # quiet mode

Generally you want CI output to be very easy to scan for errors and warnings. Control codes and verbose output make this much harder.

@victornoel
Copy link
Contributor

@sensedeep For the quiet mode, you can see #788 and for the command line option I think #1340 covers it :)

So this issue can be closed I think!

@sensedeep
Copy link

sensedeep commented Oct 24, 2016

Just tried that in 0.16.1. Seems --silent is not released yet?

 yarn --silent install

  error: unknown option `--silent'

yarn --no-progress install

  error: unknown option `--no-progress'

@victornoel
Copy link
Contributor

@sensedeep #788 is not closed so no :)

@martinbean
Copy link

The ability to both suppress progress logs and control codes would be great, as it’s making my Viaduct deployment logs look hideous:

screen shot 2016-10-26 at 09 32 51

If this is to be a drop-in replacement for npm, then it should have the user options npm offer.

@arcanis
Copy link
Member

arcanis commented Apr 28, 2017

Should be fixed with --no-progress (#1190), please reopen if that's not enough.

@arcanis arcanis closed this as completed Apr 28, 2017
@jrr
Copy link
Contributor

jrr commented Aug 14, 2018

This seems to still be a problem:

jrr@jrrmbp ~> yarn versions |more
yarn versions v1.9.4
{ yarn: ESC[32m'1.9.4'ESC[39m,
  http_parser: ESC[32m'2.8.0'ESC[39m,
  node: ESC[32m'8.11.3'ESC[39m,
  v8: ESC[32m'6.2.414.54'ESC[39m,
  uv: ESC[32m'1.19.1'ESC[39m,
  zlib: ESC[32m'1.2.11'ESC[39m,
  ares: ESC[32m'1.10.1-DEV'ESC[39m,
  modules: ESC[32m'57'ESC[39m,
  nghttp2: ESC[32m'1.32.0'ESC[39m,
  napi: ESC[32m'3'ESC[39m,
  openssl: ESC[32m'1.0.2o'ESC[39m,
  icu: ESC[32m'60.1'ESC[39m,
  unicode: ESC[32m'10.0'ESC[39m,
  cldr: ESC[32m'32.0'ESC[39m,
  tz: ESC[32m'2017c'ESC[39m }
Done in 0.02s.

@feuGeneA
Copy link

@arcanis , as @jrr mentioned, this does seem to still be a problem. I get the same output he showed, even when doing yarn versions --no-progress.

@arcanis
Copy link
Member

arcanis commented Aug 30, 2018

We would appreciate a PR.

@feuGeneA
Copy link

As much as I'd love to send a PR, it's doubtful I will have time. Would you consider re-opening the issue?

@arcanis
Copy link
Member

arcanis commented Aug 30, 2018

Not this one, the original issue is super old, and it's unclear the one you reported is the same as the one originally referenced (I suspect the problem here is that we're using require('util').inspect).

You can however create a new one, which will make it easier from anyone willing to fix the issue to extract the needed information 🙂

andrew-codes added a commit to cypress-io/cypress that referenced this issue Oct 28, 2019
removing these codes and the stripping of them from tests/snapshots

yarnpkg/yarn#728
andrew-codes added a commit to cypress-io/cypress that referenced this issue Oct 29, 2019
removing these codes and the stripping of them from tests/snapshots

yarnpkg/yarn#728
andrew-codes added a commit to cypress-io/cypress that referenced this issue Oct 29, 2019
removing these codes and the stripping of them from tests/snapshots

yarnpkg/yarn#728
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants