Cant Run Read Only Files Visual Studio
I am using Visual Studio Code 5 1.31.one. I used an input function but I tin can't write an input in output panel it shows this error
Cannot edit in read-only editor.
Please help me solve this problem.
asked Feb 24, 2019 at 20:47
AsifAsif
i,288 2 gold badges 8 silverish badges 15 bronze badges
5
- Become to File > Preference > Settings then
- blazon: run lawmaking and scroll downwards until you lot encounter code-runner: Run in final , There will be multiple options called "code-runner". In that you can find the option mentioned below.
- just check "Whether to run code in integrated terminal" and
- restart vscode.
For Mac users, it is Code > Preference > Settings.
answered Feb 26, 2019 at half dozen:19
A. TraoreA. Traore
one,526 i aureate bluecoat 7 silvery badges 7 bronze badges
5
If you can't observe where to discover code runner equally said in Ali NoumSali Traore's answer, hither'due south what you lot got to do:
- Go to extensions (Ctrl + Shift + X)
- Find lawmaking runner and click on the settings icon on bottom right of the code runner
- Click configure extensions settings
- Detect code_runner: Run in terminal
- Check "Whether to run code in last"
answered Jul 30, 2019 at xiv:eleven
HarisHaris
251 ii silver badges 6 bronze badges
1
You lot are in the "Output" tab instead of the Terminal. The output tab is actually merely for y'all to read from.
Press F5
to brainstorm Debugging
and information technology'll bring you into the Terminal tab.
The final is interactive, and so you lot tin can read output AND blazon back. It is indeed a console prompt/ final (hence its proper name).
answered Sep 30, 2019 at ix:55
I received this fault during a code compare with previous version and it wasn't letting me edit the electric current version in the Correct-Window. Unrelated to what I doubtable OP's event but this was the offset thread that came up for my search and the error was the aforementioned. 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.
answered Jun 5, 2019 at xv:01
jgrittenjgritten
780 10 silver badges 17 statuary badges
ii
The easiest way to fix this was to printing (CTRL) and (,) in VS Lawmaking to open Settings.
After that, on the search bar search for lawmaking runner, then coil down and search for Run In Terminal and bank check that box as highlighted in the beneath image:
Dharman
26.1k 20 gold badges 67 argent badges 117 bronze badges
answered Sep 25, 2020 at 10:59
Had the same problem. Here's what I did & it got me the results I wanted.
- Go to the Last of Visual studio code.
- Cd to the directory of the file that has the code you wrote and ran. Let's call the program "
xx.cpp
" - Type
g++ xx.cpp -o a.out
(creates an executable) - To run your programme, type
./a.out
answered Jul 26, 2019 at xiii:53
I received the same error similar @jgritten. But like the comment before me by @jgritten, I 'unstaged' and reopened vscode and the files. Now I 'staged' information technology again. The error "Cannot edit in read-only editor" didnt come.
Hope this reassures anyone who might have similar error afterwards staging the file using git in vscode.
answered Jul xv, 2019 at xi:06
BrianBrian
35 9 bronze badges
I was experiencing this effect while using the SFTP extension in VSCode. In this case, all you have to do is correct-click somewhere in the file and select 'edit in local'
answered Nov 12, 2020 at 13:48
HappyHands31HappyHands31
3,751 10 gold badges 46 silver badges 84 bronze badges
If your code takes input from a user y'all can't only use output tab. You lot have to use any last equally Hashemite kingdom of jordan Stefanelli have said.
- just become to last tab and select powershell or default terminal
- type python Nameoffile.py
- you will be able to input
colidyre
three,320 eleven golden badges 32 silver badges 46 bronze badges
answered April 20, 2020 at i:02
I had the Cannot edit in read-only editor
fault when trying to edit lawmaking after stopping the debug mode (for 2-3 minutes afterward pressing Shift+F5
).
Turns out the default Node version (v9.11.1) wasn't exiting gracefully, leaving VScode stuck on read-merely.
Only adding "runtimeVersion": "12.4.0"
to my launch.json file stock-still information technology.
alternatively, change your default Node version to the latest stable version (you can run across the current version on the DEBUG Console
when starting debug mode).
answered Nov xviii, 2020 at 10:31
AsafAsaf
7,890 17 gold badges 62 silver badges 113 bronze badges
Every bit the @Jordan Stefanelli answer: If you encounter the same problem as me that the integrated Terminal cannot read input from user as beneath hanging (env. Windows 10)
my solution was to supplant cygwin's gdb and g ++ with mingw64'south.
then the input output are normal
besides you lot can enable "external panel" option to solve it:)
you can modify information technology by enabling "externalConsole":true in the launch.json then you will become a popular upwards console window that you can type in.
answered Nov 27, 2019 at 8:01
傅继晗傅继晗
639 one gold badge 6 silver badges eleven bronze badges
Short Answer: Subsequently installing "Code Runner" extension, you only have to right-click the selected part of code you wish to execute and see it in the Output Tab.
answered Nov 23, 2020 at 14:nineteen
C G OC Chiliad O
41 5 statuary badges
Click on the file and hover on Preferences. there you volition find the first choice as Settings and click on that. There search run code. and scroll and find the option code runner: Run in Terminal. now check the option below it
answered Dec xix, 2020 at 6:thirteen
I had the same trouble, even though i enable the lawmaking runner to true, i was not still able to get my vsc terminal run. The quick prepare was that mentioned by @Jordan Stefanelli. I add to my setting.json in the launch section "externalConsole":truthful,
"launch": { "externalConsole":true, "configurations": [], "compounds": [] }
answered Mar 31, 2021 at xi:49
Here's the piece of cake mode: Higher up your mistake "cannot edit in read-simply editor" there volition be a path to your cpp lawmaking file, it might wait something similar this if you are running on Linux:
cd "/home/jacksparrow/Documents/projects/" && g++ exams.cpp -o exams && "/domicile/jacksparrow/Documents/projects/"exams
and then all you have to do is "re-create(ctrl+shift+C) that path address and paste(ctrl+shift+V) it in the concluding window and printing enter" right adjacent to your output and debug console window. This worked for me, hope information technology does for yous also.
answered May 7, 2021 at 17:23
In VS Code, install code runner. When running your file please specify how yous want to run the file, in the output window or concluding. For a better feel brand sure y'all have selected the concluding.
answered May 12, 2021 at 12:10
Kimanthi 1000.Kimanthi K.
259 2 silver badges 10 bronze badges
answered Feb 7 at iii:29
NigilanNigilan
726 1 gilt badge 6 silvery badges 17 bronze badges
Not the answer you're looking for? Scan other questions tagged visual-studio-code or inquire your own question.
Source: https://stackoverflow.com/questions/54856374/cannot-edit-in-read-only-editor-vs-code
0 Response to "Cant Run Read Only Files Visual Studio"
Post a Comment