I am using Visual Studio Code V 1.31.1. I used an input function but I can't write an input in output panel it shows this error
Cannot edit in read-only editor.
Please help me solve this problem.
I am using Visual Studio Code V 1.31.1. I used an input function but I can't write an input in output panel it shows this error
Cannot edit in read-only editor.
Please help me solve this problem.
go to file>preference>settings then
type: run code and scroll down until you see code-runner: Run in terminal,
just check "whether to run code in integrated terminal" and restart vscode.
For Mac users, it is Code>preference>settings.
whether to run code in integrated terminal
and got exactly one to check
– Hidayt Rahman
Sep 1 at 8:43
I received this error during a code compare with previous version and it wasn't letting me edit the current version in the Right-Window. Unrelated to what I suspect OP's issue but this was the first thread that came up for my search and the error was the same. anyway...
My issue was that the particular file was 'Staged' in my source control at the time. This appears to restrict editing by opening an 'index' version for the compare.
Solution: Un-stage the file, and reopen the comparative window.
I received the same error like @jgritten. Just like the comment before me by @jgritten, I 'unstaged' and reopened vscode and the files. Now I 'staged' it again. The error "Cannot edit in read-only editor" didnt come.
Hope this reassures anyone who might have similar error after staging the file using git in vscode.
If you can't find where to find code runner as said in Ali NoumSali Traore's answer, here's what you got to do:
You are in the "Output" tab instead of the Terminal. The output tab is actually only for you to read from.
Press F5
to begin Debugging
and it'll bring you into the Terminal tab.
The terminal is interactive, so you can read output AND type back. It is indeed a console prompt/ terminal (hence its name).
Had the same problem. Here’s what I did & it got me the results I wanted.
xx.cpp
"g++ xx.cpp -o a.out
(creates an executable)./a.out
as the same answer above: https://stackoverflow.com/a/58165475/10096812
and if you encounter the same problem as me that the integratedTerminal cannot read input from user as below hanging(env. windows 10)
my solution was to replace cygwin's gdb and g ++ with mingw64's.
then the input output are normal
also you can enable "external console" option to solve it:)
you can change it by enabling "externalConsole":true in the launch.json then you will get a pop up console window that you can type in.