Vscode-code-runner: Can't take input

Created on 22 Feb 2018  Â·  6Comments  Â·  Source: formulahendry/vscode-code-runner

When running code (Python, C/C++ etc) I can't take input from keyboard. The text output is showing correctly. But when it needs to take input from keyboard (i.e. input() function from python, scanf() from c) the output console is not working. There is no response from keyboard. I can write code on editor correctly, but can't write in output console.
I'm running the latest version (both vs code and code runner extension).

question

Most helpful comment

Can confirm.
Workaround:
Open settings and add to the .json file:

// Whether to run code in Integrated Terminal.
    "code-runner.runInTerminal": true,

This opens the code in the terminal which has a working input.
But then the shortcut for stop run code doesnt work...

All 6 comments

Can confirm.
Workaround:
Open settings and add to the .json file:

// Whether to run code in Integrated Terminal.
    "code-runner.runInTerminal": true,

This opens the code in the terminal which has a working input.
But then the shortcut for stop run code doesnt work...

Thanks. It worked. But what is the problem in output console? Can't it be fixed?
There is no need of stop run code because I can simply kill the Terminal to stop running code.

@hosainm You are right. stop run code is no need when running in terminal.
If you want to input, need this setting "code-runner.runInTerminal": true

谢谢,完美解决了我的问题.而且输入进到ZSH了

欢迎

I got the same problem with you. I wrote a C file and used CODE RUNNER to run it, but it had nothing to show in the console. And if I re-clicked the running button, it popped a small window indicates that the code was still running. After that I tried to delete the scanf() function, everything ran in the right way. So I had to execute it only in the terminal. Anyway, it's not a big deal. But I hope this issue could be solved one day. ^_^

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mjaniec2013 picture mjaniec2013  Â·  5Comments

0x7FFFFFFFFFFFFFFF picture 0x7FFFFFFFFFFFFFFF  Â·  3Comments

emadb picture emadb  Â·  5Comments

w3adventures picture w3adventures  Â·  3Comments

waithope picture waithope  Â·  5Comments