I know @KurtE is already aware of it, but in order to make relevant information available to others who are interested in this subject, I'll share a link to the formal bug report the Arduino IDE developers are using to track this:
opened 04:07PM - 06 Feb 23 UTC
topic: code
type: imperfection
### Describe the problem
Arduino IDE's editor view has two distinct modes: the … normal mode where the text can be edited, and a "read-only" mode where the contents of the file are displayed, but the user is prevented from modifying them. The "read-only" mode is indicated to the user by the presence of a closed padlock icon on the editor tab, a "Read-only" suffix on the editor tab tooltip, and a "Cannot edit in read-only editor" message appearing if the user attempts to edit.
The IDE intentionally puts the editor into this mode under any of the following conditions:
- The file is outside the sketch path (which would typically occur when a file is opened via "Go to definition").
- The read-only file attribute is set in the file system.
🐛 If a sketch is a symbolic link or Windows directory junction, when that sketch is opened via the IDE's **File > Sketchbook** menu or the "**SKETCHBOOK**" view, the editor is incorrectly put into the "read-only" mode.
### To reproduce
1. Select **File > New** from the Arduino IDE menus.
1. Select **File > Save As...** from the Arduino IDE menus.
1. Save the sketch with the name "Target" in the root of the sketchbook folder.
**ⓘ** The specific name and location of this sketch are not required conditions for the fault to occur. They are only specified to simplify the instructions in this demonstration. The fault will occur even if the link target is not under the sketchbook folder.
1. Select **File > Quit** from the Arduino IDE menus.
1. Open a command line terminal in the sketchbook folder.
1. Type the following command:
- **If you are using Linux or macOS:**
```text
mkdir link && ln -s "$PWD/Target" "$PWD/link/Target"
```
- **If you are using Windows PowerShell:**
```text
New-Item -ItemType "directory" -Name link; New-Item -ItemType Junction -Path ".\link\Target\" -Value ".\Target"
```
- **If you are using Windows cmd:**
```text
mkdir link & mklink /J link\Target Target
```
1. Start Arduino IDE.
1. Select **File > Sketchbook > link > Target** from the Arduino IDE menus.
1. Try to edit the sketch file.
🐛 The edit is not allowed and a tooltip appears:
> **Cannot edit in read-only editor**
### Expected behavior
Sketches opened from symbolic links/directory junctions should be editable.
### Arduino IDE version
#### Original report
2.0.0-rc3
#### Last verified with
aa9b10d
### Operating system
- Linux
- macOS
- Windows
### Operating system version
- Ubuntu 22.04
- macOS Sonoma
- Windows 10
- Windows 11
### Additional context
The fault does not occur if the sketch is opened via any of the alternative methods:
- **File > Open**
- **File > Open Recent**
- Opening the sketch via file association to the Arduino IDE application
- Passing the sketch path via command line argument to the Arduino IDE invocation
- IDE restoring previously opened sketches on startup
#### Additional reports
- https://github.com/arduino/arduino-ide/issues/850
- https://forum.arduino.cc/t/sketch-opens-up-read-only/1221298
- https://forum.arduino.cc/t/arduino-ide-2-3-4-read-only-issue/1340405
#### Related
- https://forum.arduino.cc/t/symbolic-link-sketch-opens-in-read-only-mode/960917
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [x] My report contains all necessary details