1

When using stock VS Code Version: 1.71.2 on macOS 12.6:

A file that is chmod 444 does not show the 'lock' icon and does not block edit actions. vscode only reports that it is 'read-only' when one tries to write the file.

Q: is that intentional or a bug? or something new to macOS-12.6?

Q: Does vscode to the right thing on Windows or Linux? (that is: show the 'lock' and block edit acions)

Jack Punt
  • 342
  • 1
  • 14

1 Answers1

0

I've been told this is known and possibly intentional: https://github.com/microsoft/vscode/issues/134876#issuecomment-940851828

On the other hand, I found that it is trivial to fix, and was likely an oversight/bug. This (line 93; plus constructor arg) will fix the problem https://github.com/jackpunt/vscode/commit/7639971f3d0467ec6c923b89bf189bdc653b9969

You can clone that repo to get that fix, and also all read-only goodies from https://github.com/microsoft/vscode/issues/161715#issuecomment-1262947768

(still [Nov 2022] waiting for the vscode owners to pull that...)

Related: https://github.com/microsoft/vscode/issues/17670

Included in VScode! in the May 2023 release; Detect read-only files and mark files as non-editable by Glob Pattern.

Jack Punt
  • 342
  • 1
  • 14