pingdotgg / pingdotgg/t3code

macOS: apps launched from integrated terminal can't request TCC permissions (mic, camera)

Open
#728 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Problem

When running an app that needs microphone or camera access from T3 Code's integrated terminal, macOS never shows the permission prompt — it silently fails. The same app works fine when launched from a standalone terminal (e.g. Ghostty).

This affects both dev and production builds.

Cause

macOS TCC requires two things to show privacy permission prompts for child processes:

  1. A valid code signature on the parent app bundle
  2. Usage description keys in the app's Info.plist (e.g. NSMicrophoneUsageDescription)
Dev builds

The dev launcher (apps/desktop/scripts/electron-launcher.mjs) patches the Electron app bundle's Info.plist (display name, bundle ID, icon) but doesn't re-sign the bundle afterward. This invalidates the existing code signature, so TCC silently denies all permission prompts for child processes.

Production builds

The mac build config in scripts/build-desktop-artifact.ts has two issues:

  1. No usage description keysNSMicrophoneUsageDescription, NSCameraUsageDescription, etc. are not included in the mac extendInfo, so macOS doesn't know the app needs those permissions.
  2. Unsigned builds have no signature at allCSC_IDENTITY_AUTO_DISCOVERY is set to "false" for all unsigned builds, which disables signing entirely. Without even an ad-hoc signature, TCC can't attribute permissions to the app.

Suggested fix

Dev (~11 lines, 1 file)

Ad-hoc re-sign the app bundle after patching plists in electron-launcher.mjs:

spawnSync("codesign", ["--force", "--deep", "--sign", "-", appBundlePath]);

I've tested this locally and it resolves the issue for dev.

Prod
  1. Add NSMicrophoneUsageDescription and NSCameraUsageDescription to the mac build config via extendInfo.
  2. For unsigned mac builds, use ad-hoc signing (identity: "-") instead of disabling signing entirely.

I haven't been able to test the prod fix locally (no signing setup), but the approach matches Apple's TCC documentation.

Reproduction

  1. Open a project in T3 Code (desktop, macOS)
  2. In the integrated terminal, run any app that requests microphone or camera access
  3. No permission prompt appears; the app fails silently
  4. Run the same command in an external terminal — it works

PR

I created a PR, but I think it was auto closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/desktop/scripts/electron-launcher.mjs and scripts/build-desktop-artifact.ts, then review the dev bundle plist patching and mac build configuration described in the issue. Reproduce the microphone or camera case on macOS for both dev and production builds. Done means apps launched from the integrated terminal receive the expected TCC permission prompts.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, macos, typescript
Domain
build-system, desktop, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.