Cannot edit in read-only editor VS Code

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:

  1. Go to extensions (Ctrl + Shift + X)
  2. Find code runner and click on the settings icon on bottom right of the code runner
  3. Click configure extensions settings
  4. Find code_runner: Run in terminal
  5. Check "Whether to run code in terminal"

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.


You are in the "Output" tab instead of the Terminal. The output tab is actually only for you to read from.

enter image description here

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).

enter image description here


  1. Go to File > Preference > Settings then
  2. type: run code and scroll down until you see code-runner: Run in terminal, There will be multiple options called "code-runner". In that you can find the option mentioned below.
  3. just check "Whether to run code in integrated terminal" and
  4. restart vscode.

For Mac users, it is Code > Preference > Settings.