Repository navigation
Fix Open in Terminal doing nothing in released builds - #638
Conversation
|
Thanks for testing it. I could not get your result here, so I measured the I downloaded
So the released build does drop the command, on a machine where it had never One thing makes our two observations hard to compare: the About box cannot tell Could you run this against the app you tested? The release answers Worth ruling out one more thing: your recording shows no consent dialog, so and retrying would tell us whether an existing grant is what carries it Unrelated aside: do not test with the |
cf85b3c to
6274dff
Compare
|
@hannesa2 whenever you have a moment, could you run the two commands from my comment above? |
Opening a repository in a terminal is carried entirely by an Apple event, which the hardened runtime refuses to send unless the application asks for the privilege. * Declare com.apple.security.automation.apple-events, so the command reaches Terminal or iTerm2 instead of being rejected below the consent layer, where it produces neither a prompt nor an error. * Cover the entitlement with a test. The restriction is lifted for local builds by com.apple.security.get-task-allow, so the failure never shows up when building from Xcode and needs guarding rather than noticing. * Link Security.framework into the test target, which the check needs.
6274dff to
b762deb
Compare
sure - I've rebased it now - should pass the CI-tests soon, thanks |




Opening a repository in a terminal is carried entirely by an Apple event, which
the hardened runtime refuses to send unless the application asks for the
privilege. Released builds are signed with that runtime and an empty
entitlements file, so
Repository > Open in Terminallaunches the terminal andthen silently drops the command that was supposed to
cdinto the repository.Fixes #636, where the diagnosis is written up in full.
Changes
com.apple.security.automation.apple-eventsinGitX.entitlements,so the event reaches Terminal or iTerm2 instead of being rejected with
errAEEventNotPermitted (-1743)below the consent layer, where it producesneither a prompt nor an entry in
Privacy & Security > Automation.PBGitXEntitlementsTests, asserting the running application carries theentitlement. Worth guarding, because
com.apple.security.get-task-allowlifts the same restriction for locally built copies: the feature works when
built from Xcode and fails only in the shipped app, which is how this
survived since at least fails to open console in the current directory #460.
Security.frameworkinto the test target, whichSecTaskneeds.Test plan
make unit-testfails on the new test before the entitlement is added(
GitX cannot drive a terminal application without this entitlement) andpasses after it, 106 tests green.
codesign -d --entitlements -on the built app shows the key in thesignature.
unchanged:
-o runtimewith no entitlements gives-1743and no prompt,-o runtimeplus this entitlement succeeds, and-o runtimeplusget-task-allowalso succeeds.Note that
Resources/GitX.entitlementsis a second, unreferenced copy of thisfile, still empty.
CODE_SIGN_ENTITLEMENTSpoints at the one in the projectroot, so it is left alone here.