-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
author-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersmacosIssues with VS Code on MAC/OS XIssues with VS Code on MAC/OS XterminalGeneral terminal issues that don't fall under another labelGeneral terminal issues that don't fall under another labelverifiedVerification succeededVerification succeeded
Milestone
Description
- VS Code Version: 1.54.3
- OS Version: macOS 10.15.7 (19H524)
Steps to Reproduce:
- macOS specific
- Develop a project in VSCode that somewhere down the chain uses call to
NSAppleScript
. In my case it is an Electron project thatspawn
s multiple native binaries written in Swift where one of them usesNSAppleScript
and pipes data between Electron main process and native runtime. - Run the project through VSCode terminal (in my case it is live reloading Electron project).
- macOS security system will not ask user permission to allow access for VSCode to some other apps AE dictionary.
- Yes, VSCode, not the app developed via VSCode, because VSCode encapsulates the process and spawned subprocesses, it is the main bundle in this case.
- When some process wants to access AE dictionaries for other apps a permission to macOS is asked which in turn results in permissions dialog represented to user. Permission can be denied or granted, and the entry with chosen allowance will show up in Automation anchor under System preferences : Security & Privacy.
- In order for this to work the bundle that encapsulates the runtime that uses AE has to have
entitlement
<key>com.apple.security.automation.apple-events</key>
<true/>
Info.plist entry
<key>NSAppleEventsUsageDescription</key>
<string>Bla bla</string>
N.B. Entries NSAppleScriptEnabled
and OSAScriptingDefinition
are different beasts.
- Due to VSCode entitlements and Info.plist settings the call will not go through, that is - process running in VSCode terminal will not signal macOS gatekeeper that permission to access specific app AE is asked, user (in this case a developer using VSCode) will not be notified, System preferences : Security & Privacy : Automation will not populate, and app development/debugging cannot happen.
- Note that current VSCode setup passes through subprocesses that need Accessibility and Screen Recording permissions (I use them in my binaries, too) - System preferences : Security & Privacy anchors Accessibility and Screen Recording will populate. Not relevant to me, but I imagine that other permissions under
com.apple.security.*
cases might fail Apple docs on Hardened Runtime
IMHO, VSCode should open up permissions as its terminal serves for live debugging apps that may ask different kind of permissions to OS. Due to the very nature of VSCode I consider this to be a bug not missing feature.
Does this issue occur when all extensions are disabled?: Yes
Metadata
Metadata
Assignees
Labels
author-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersmacosIssues with VS Code on MAC/OS XIssues with VS Code on MAC/OS XterminalGeneral terminal issues that don't fall under another labelGeneral terminal issues that don't fall under another labelverifiedVerification succeededVerification succeeded