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

Progress bar is printed on new lines in Windows in CMD #2530

Closed
bestander opened this issue Jan 23, 2017 · 33 comments
Closed

Progress bar is printed on new lines in Windows in CMD #2530

bestander opened this issue Jan 23, 2017 · 33 comments

Comments

@bestander
Copy link
Member

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

What is the current behavior?

Progressbar is printing every new state in a new line in Windows 10 default CMD

yarn-on-windows

Please mention your node.js, yarn and operating system version.
Node 7.3.0
Windows 10

@bestander
Copy link
Member Author

A possible solution https://github.com/lerna/lerna/pull/92/files thanks to @kentaromiura

@Daniel15
Copy link
Member

Daniel15 commented Jan 24, 2017

This was supposed to be fixed by #526 😢 It works for me in both Cmder and cmd.exe?

@bestander
Copy link
Member Author

It actually works fine on my home Windows PC which has a few CMD features enabled: bash for windows, chocolatey and maybe some other developer options.
The PC I tested this on was a bare windows 10 with no additional software installed except for node and yarn 0.19

@simonbuchan
Copy link

microsoft/WSL#1936 seems to imply the issue is specific to certain fonts, i.e. it's a rendering issue not an process output issue.

@kaiyoma
Copy link

kaiyoma commented May 2, 2017

I see this issue as well when running yarn install. I'm running git bash (part of Node.js 6.9.1) on Windows 10.

progress-bar-issue-1

progress-bar-issue-2

@mrmckeb
Copy link

mrmckeb commented May 2, 2017

It does look like this is caused by the typeface you use. @kaiyoma - which font are you using here?

@kaiyoma
Copy link

kaiyoma commented May 2, 2017

11-point Consolas. Pretty popular for programmers. :-)

@mrmckeb
Copy link

mrmckeb commented May 2, 2017

@kaiyoma, take a look at microsoft/WSL#1936. Sadly this isn't going to be fixed any time soon. I'm not sure if it's something the Yarn team could help with by doing something different...

@kaiyoma
Copy link

kaiyoma commented May 3, 2017

Interesting. Are we sure this is the same issue? I'm using the git bash that comes with the Windows installer of Node.js and I haven't installed the "BashOnWindows" project for running Linux binaries. Are they the same thing?

@simonbuchan
Copy link

simonbuchan commented May 3, 2017 via email

@kaiyoma
Copy link

kaiyoma commented May 3, 2017

I've disabled progress bars for now (yarn config set no-progress true). Having a font I like is infinitely more important than progress bars, which I never had anyway when using npm.

@sylvainpolletvillard
Copy link

I have a similar problem with Hyper and IntelliJ terminal on Windows. It may be related to a new version of Yarn or a Windows update, I'm not sure. It works correctly on Powershell.

2017-05-06_14-22-40

@gluons
Copy link

gluons commented May 12, 2017

Same problem with Windows 10 Creators Update.

Copy from #3383

  • On PowerShell:

    1 2
  • On CMD:

    3 4

@gluons
Copy link

gluons commented Sep 5, 2017

Excuse me. Does anyone have an idea to fix this? It's really annoying problem. 😢

@simonbuchan
Copy link

Change your console font settings to a known good (Been a while, but Consolas 14pt works I think? Depends on font and size combination), or disable yarn progress bars with yarn config set no-progress until new console rendering arrives - see microsoft/WSL#1936

@gluons
Copy link

gluons commented Sep 5, 2017

@simonbuchan OK. I'm using Fira Mono font now. I'll try yarn config set no-progress. Thank you. 🙇‍♀️

@BYK
Copy link
Member

BYK commented Sep 5, 2017

I'm on Windows and I don't have this problem. That said I'm using Conemu and the latest nightlies of Yarn. Just tried in PowerShell with yarn check and it seems fine.

Anyone can try with the latest nightlies and confirm this still exists?

@sylvainpolletvillard
Copy link

The problem is solved for me with yarn 0.27.5 on default Windows CMD

@BYK
Copy link
Member

BYK commented Sep 5, 2017

The problem is solved for me with yarn 0.27.5 on default Windows CMD

🎉

@BYK BYK closed this as completed Sep 5, 2017
@KayLeung
Copy link
Contributor

KayLeung commented Sep 5, 2017

I still experienced the problem. Windows 10 Pro Insider Build 16281

@BYK
Copy link
Member

BYK commented Sep 5, 2017

@KayLeung which version of Yarn?

@KayLeung
Copy link
Contributor

KayLeung commented Sep 5, 2017

@BYK

yarn check v0.27.5

I tried Powershell / CMD / Conemu

@sylvainpolletvillard
Copy link

So after a few tests, it appears it depends on the terminal font. Here is my tests with Consolas 20 on the left, and Meslo LG M on the right:

2017-09-05_19-36-55

Yet the result is much better than what I had with yarn 0.23

@KayLeung
Copy link
Contributor

KayLeung commented Sep 5, 2017

I also tried yarn check v1.0.0, same bug.

@sylvainpolletvillard,
It seems Consolas will help in CMD but some square characters like the GIF above.

Conemu with Consolas (tried diff font-size), same bug.

Just reminded the Bar in Jest is working well. Maybe Yarn could borrow some code from there: jestjs/jest#3626

@KayLeung
Copy link
Contributor

KayLeung commented Sep 5, 2017

I've done some quick testing, it worked: #4317

@gluons
Copy link

gluons commented Sep 6, 2017

0.27.5 is still broken for me.

@BYK Do not close the issue that isn't completely resolved.

This issue should be opened until we get confirmed fix. (Maybe #4317 ?)

default

@BYK
Copy link
Member

BYK commented Sep 6, 2017

@BYK Do not close the issue that isn't completely resolved.

I closed the issue because I think this is a bug in Windows, not Yarn. Sorry for not being clear on that.

@BYK BYK reopened this Sep 6, 2017
@BYK
Copy link
Member

BYK commented Sep 6, 2017

Okay, I think we need to specify the output encoding when writing or simply do process.stdout.setDefaultEncoding('utf-8'); when creating the reporter.

@KayLeung would you like to give it a try?

@gluons
Copy link

gluons commented Sep 6, 2017

Thank you for reopen.
It will be easy to search when someone face this problem and search with default is:issue is:open. 😄

@swrobel
Copy link

swrobel commented Sep 8, 2017

FWIW, I have this same issue in Terminal.app on macOS 10.12.6 using Hack 2.020. I've tried several different reasonable font sizes, all with the same result.

@BYK BYK closed this as completed in #4317 Sep 13, 2017
BYK pushed a commit that referenced this issue Sep 13, 2017
**Summary**
Fixes #2530. This patch replaces the 2-byte progress bar characters with `-` and `#` wrapped in a pair of `[` and `]` symbols to make it looks like a progress bar on the console with "simple", one-byte characters.

The reason for preferring one-byte characters is the inconsistent width calculation on certain terminal emulators causing the calculated progress bar width to overflow the available terminal width, causing the progress bar to split into multiple lines.

It now looks like this:
![new progress bar chars](https://i.imgur.com/d8XA4yS.gif)

**Test plan**

Manual verification and updating of existing test snapshots.
@gluons
Copy link

gluons commented Sep 14, 2017

Wow! Thank you

@gluons
Copy link

gluons commented Sep 14, 2017

It's fixed. 🎉

Grab the artifact from https://ci.appveyor.com/project/kittens/yarn/build/3769/job/3owvdyefkpofp10x/artifacts

default

@BYK
Copy link
Member

BYK commented Sep 14, 2017

This was the same issue with #1222.

joaolucasl pushed a commit to joaolucasl/yarn that referenced this issue Oct 27, 2017
…kg#4317)

**Summary**
Fixes yarnpkg#2530. This patch replaces the 2-byte progress bar characters with `-` and `#` wrapped in a pair of `[` and `]` symbols to make it looks like a progress bar on the console with "simple", one-byte characters.

The reason for preferring one-byte characters is the inconsistent width calculation on certain terminal emulators causing the calculated progress bar width to overflow the available terminal width, causing the progress bar to split into multiple lines.

It now looks like this:
![new progress bar chars](https://i.imgur.com/d8XA4yS.gif)

**Test plan**

Manual verification and updating of existing test snapshots.
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

10 participants