Change:
To recreate: Edit a file requiring sudo (eg ) When saving, VSCode will request sudo permissions and, after granting, gives the following error: I do NOT have Rosetta installed but understand VS Code is supposed to be M1 compatible. Here is the version info:
I cannot reproduce and I am on a M1 as well. thoughts? did you install the universal app?
For triggering we use a 3rd-party module which on macOS uses osascript saved as application bundle As a quick check, trigger a sudo prompt from vscode and open the OS temp directory and check for , following is the executable architecture So unless the user has rosetta installed this application will not be launched on M1 as reported here. you might have rosetta installed hence the failure was not seen, can be confirmed with
Not sure if that applet can be converted to universal, might also be worth looking at alternatives for sudo-prompt given that repo is now archived.
I would suggest to fork the module and convert that applet to universal if that is straightforward.
I don't see the source for the applet under the user repositories, will have to reach out to the author.
Maybe:
would you be able to test this scenario again from the following build that includes a potential fix:
Thanks for all your efforts on this (and . I discovered this on a new M1 Mac where I had not yet installed Rosetta but eventually caved in and installed it. Unfortunately it doesn't appear Rosetta can be easily uninstalled for testing. Happy to give this another go the next time I have a fresh Mac install but don't foresee that in the immediate future...
Verification on a mac with ARM chip without Rosetta 2 installed ([1]) use open try to edit (in the comment area!!!) from the error retry as sudo verify you get a prompt and save works [1] The presence of these files are a good indicator that you have Rosetta2 installed:
I take it you just re-compiled the applet for universal & updated the package with the base64 encoded string (is that right?)
yes! Here is what I did: decode the base64 encoded value unzip it open the apple script in apple script editor export it as application bundle (I have Rosetta 2 installed so it seems to export as universal bundle by default) zip it base64 encode it release as fork from

Discussion:
"@microsoft/applicationinsights-web": "^2.6.4", "@parcel/watcher": "2.0.2", "@vscode/sqlite3": "4.0.12", <ins> "@vscode/sudo-prompt": "^9.3.0", </ins> "@vscode/vscode-languagedetection": "1.0.21", "applicationinsights": "1.0.8", "graceful-fs": "4.2.8",

"native-watchdog": "1.3.0", "node-pty": "0.11.0-beta11", "spdlog": "^0.13.0", <del> "sudo-prompt": "9.2.1", </del> "tas-client-umd": "0.1.4", "v8-inspect-profiler": "^0.0.22", "vscode-nsfw": "2.1.8",

} async writeElevated(windowId: number | undefined, source: URI, target: URI, options?: { unlock?: boolean }): Promise<void> { <del> const sudoPrompt = await import('sudo-prompt'); </del> <ins> const sudoPrompt = await import('@vscode/sudo-prompt'); </ins> return new Promise<void>((resolve, reject) => { const sudoCommand: string[] = [`"${this.cliPath}"`];

dependencies: nan "2.14.2" <ins> "@vscode/sudo-prompt@^9.3.0": version "9.3.0" resolved "https://registry.yarnpkg.com/@vscode/sudo-prompt/-/sudo-prompt-9.3.0.tgz#5c63b195986d1d6a142856146e51c6b46a3319b2" integrity sha512-/c/A4/fEBhKXiEW2+Cv8qid6uWA6Igg9iaHrlMoNyoHynziYLYFCaF8lGcmvQ20wEi5l7xyx4YxG2h5nVKazeg== </ins> "@vscode/vscode-languagedetection@1.0.21": version "1.0.21" resolved "https://registry.yarnpkg.com/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz#89b48f293f6aa3341bb888c1118d16ff13b032d3"

postcss "^7.0.0" postcss-selector-parser "^3.0.0" <del> sudo-prompt@9.2.1: version "9.2.1" resolved "https://registry.yarnpkg.com/sudo-prompt/-/sudo-prompt-9.2.1.tgz#77efb84309c9ca489527a4e749f287e6bdd52afd" integrity sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw== </del> sumchecker@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-3.0.1.tgz#6377e996795abb0b6d348e9b3e1dfb24345a8e42"