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

"Live" output #70

Closed
N2ITN opened this issue Jan 30, 2017 · 5 comments
Closed

"Live" output #70

N2ITN opened this issue Jan 30, 2017 · 5 comments

Comments

@N2ITN
Copy link

N2ITN commented Jan 30, 2017

I noticed this app only shows the output of code after it's 100% finished running.
When I'm running data / time intensive tasks, it's nice to have a live output as the task computes, similar to a terminal.
Is there a way to enable this currently without using the integrated terminal? If not, it would be an excellent addition.

@formulahendry
Copy link
Owner

Hi @N2ITN , are you running Python or other languages? I meet with this issue with Python, while JS and other languages is working normally with 'live' output.
As workaround, you could go to File > Preferences -> User Settings to add setting as below:

{
    "code-runner.runInTerminal": true
}

It will let you run code in built-in terminal with 'live' output.

@formulahendry
Copy link
Owner

formulahendry commented Feb 3, 2017

Seems like you already try using integrated terminal. 😄 Not sure whether you are running Python or others.

@N2ITN
Copy link
Author

N2ITN commented Feb 3, 2017 via email

@richardcooper
Copy link

This can be fixed for Python by adding:

 "code-runner.executorMap.python": "python -u"

to your settings.json file. Other executors might have similar settings.

By default python will buffer stdout unless it detects that it is attached to a terminal. The -u flag forces stdin, stdout and stderr to be unbuffered regardless of what it is attached to.

I think using "python -u" should probably be the default in vscode-code-runner

@formulahendry
Copy link
Owner

Hi all, I just publish a new release. Now, "python -u" is the default setting. Thank you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants