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

Does not generate output in VS Code #179

Open
relief-melone opened this issue Aug 23, 2018 · 4 comments
Open

Does not generate output in VS Code #179

relief-melone opened this issue Aug 23, 2018 · 4 comments

Comments

@relief-melone
Copy link

Hey,

I'm using the progress bar in a project of mine. Strangely it shows up in GitBash in cmd and in the powershell but it doesn't show in the vs code debugger. Do you have any explanations? So far I've not been able to get it to work.

@matthewjumpsoffbuildings

im having the opposite issue - it shows in vscode (which is set to use gitbash), but doesnt show in the standalone git bash

@matthewjumpsoffbuildings
Copy link

matthewjumpsoffbuildings commented Dec 6, 2018

This seems to be related to #133

Another observation - for me, the progress bar doesnt appear when I use Program Files\Git\git-bash.exe, however if i use Program Files\Git\bin\bash.exe it DOES appear. The second exe (bash.exe) is what my VSCode is set up to use, perhaps this is why some people are seeing it and others not

edit:
It seems the difference is that git-bash.exe has process.stderr.isTTY as undefined, but bash.exe has it as true

Something about the way stderr/stdout behaves when it is in TTY mode is what is causing this issue i think

edit 2:
I think its because git-bash actually calls bash.exe and pipes between it, so calls to stderr get sent to the wrong place and dont display? but im not sure, i dont know heaps about bash/piping

edit 3:
I just noticed that in the render function there is this

 if (!this.stream.isTTY) return;

that would explain why nothing is happening. if its impossible to get the correct behaviour if the stream is not TTY, can we at least have some kind of graceful degradation?

@matthewjumpsoffbuildings

Ok it turns out this issue is resolved by #168

In the meantime i fixed it by just doing this:

if(!process.stderr.isTTY){
	const tty = require('tty').WriteStream.prototype;
	for(var key in tty){
		process.stderr[key] = tty[key]
	}
	process.stderr.columns = 80
}

@jrrcdev
Copy link

jrrcdev commented Aug 7, 2022

Adding the follow option to launch.json works:

"console": "integratedTerminal"

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

3 participants