Incomplete output displayed and [Done] exited with code=null
See original GitHub issueWhen running a program with lots of console output, I’m getting a “[Done] exited with code=null in 0.0XX seconds” before all of the output has actually been written to the console.
Below is a simple Python3 example to reproduce the problem. Each time the code is run, the console output will enumerate to a different count value before it stops with the code=null exit code.
for count in range(100000):
print(count)
The output window displays…
...
37345
37346
37347
37348
37349
37
[Done] exited with code=null in 0.044 seconds
If I run the same example in the Visual Studio Code terminal window, the full expected output is displayed every time.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:16 (3 by maintainers)
Top Results From Across the Web
My VS CODE extension code runner isnt working
in my case solution was to uncheck "Show Execution Message" check box in Run Code configuration. setting.
Read more >I'm getting an error in output "exited with code=1" in VS Code ...
I have written a neat code of Hello World program in VS code but when I click on run, it shows an error...
Read more >concurrently - npm
I like task automation with npm but the usual way to run multiple commands concurrently is npm run watch-js & npm run watch-css...
Read more >http_response_code - Manual - PHP
The above example will output: ... function http_response_code($code = NULL) { if ($code !== ... exit('Unknown http status code "' . htmlentities($code) ....
Read more >picocli - a mighty tiny command line interface
n", user, base64(md.digest())); // null out the arrays when done Arrays.fill(bytes, ... invalid: missing file parameters <command> -n 123.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not a Javascript/NodeJS programmer, but I did some reading of the code in this extension, as well as the NodeJS API, and think I may have come across something interesting.
I see that the exec() fucntion of child_process is being used in the executeCommandInOutputChannel() function in the codeManager.ts file. I’m understanding that exec() spawns a shell and executes the command within that shell, buffering any generated output. There is a maxBuffer option that is documented as:
https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
It looks as though the spawn() function should be used instead, since the data is streamed as standard IO objects – not buffered strings.
For quick turnaround, you could use below setting (
File
->Preference
->Settings
) to run code in Integrated Terminal:Also, you may try below setting to run:
Are those options working for you?