Lỗi cannot edit in read only editor vscode
You can also open the settings screen by pressing Show Copied!
4 on Windows and Linux or Copied!
5 + Copied!
4 on macOS.
Make sure to check the Code-runner: Run in terminal checkbox as shown in the code sample. Alternatively, you can enable the setting directly in your settings.json file.
Note: you can also press Copied!
2 to open the Command Palette.
Copied!
Either approach works. After you set the setting, restart VS Code:
Note: you can also press Copied!
2 to open the Command Palette.
Try to run your code after having enabled the setting. You can click on the arrow in the top right corner to run your code in the terminal. You can also right-click in the editor window and select Run Code. You can also use the Command Palette:
Note: you can also press Copied!
2 to open the Command Palette.
Using the Stop Code Run command in the Output tabIf your code is stuck in the Output tab, right-click and select Stop Code Run. You can also stop the Code Runner process by using a keyboard shortcut:
Restart all VS Code instances if the error persistsIf the error persists, you might have a VS Code process that runs in the background. On Windows, open CMD and run the following command to stop all VS Code processes. Copied!
On macOS and Linux, run the following command to stop all VS Code processes. Copied!
If the `settings.json`5 command doesn't succeed on macOS or Linux, try issuing the following command instead. Copied!
Once you run the command and stop all VS Code processes, restart the IDE and try to run your code. Closing the terminal properly once you're doneNote that when you click on the `settings.json`6 icon at the top right corner of the terminal, you don't actually close it. If you click on the `settings.json`6 icon, the terminal still runs in the background. You need to click on the trash bin icon to close it and stop the process. Trying to edit your default settings.json fileYou can't edit the default Instead, you should open the global user's
Note: you can also press Copied!
2 to open the Command Palette.
Now you can edit the non-default version of the If you want to read more about the different ways to open and edit`settings.json`, check out my other article:
Trying to edit the left side of a git diff file comparisonIf you clicked on the source control icon in the Activity bar on the left, you most likely opened a git diff split screen. The left side of the screen is the previous version of the file, so you aren't able to edit it. To resolve the issue, click on the explorer icon at the top of the Activity bar and open the file in editable mode. You shouldn't see two versions of the file in a split screen once you open it in editable mode. Try to disable your extensionsIf the error persists, try to disable your extensions.
Note: you can also press Copied!
2 to open the Command Palette.
If you can edit the file after disabling all installed extensions, try to enable them one by one to see which extension caused the issue. I've also written an error on how to solve the issue where the Live Server extension doesn't work in VS Code. |