From e6abe45bc7295fac9ad627ca91414ac713b052bb Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 24 Apr 2026 14:44:21 -0700 Subject: [PATCH] Revert "fix(terminal): terminal mic access" (#1057) --- resources/build/entitlements.mac.plist | 2 -- src/main/index.ts | 23 +------------------ .../diff-comments/useDiffCommentDecorator.tsx | 5 ++-- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/resources/build/entitlements.mac.plist b/resources/build/entitlements.mac.plist index 0d3e45f0e..bbe60166c 100644 --- a/resources/build/entitlements.mac.plist +++ b/resources/build/entitlements.mac.plist @@ -2,8 +2,6 @@ - com.apple.security.device.audio-input - com.apple.security.cs.allow-dyld-environment-variables com.apple.security.cs.allow-jit diff --git a/src/main/index.ts b/src/main/index.ts index 495ce73f8..e987b92eb 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, nativeImage, nativeTheme, systemPreferences } from 'electron' +import { app, BrowserWindow, nativeImage, nativeTheme } from 'electron' import { electronApp, is } from '@electron-toolkit/utils' import devIcon from '../../resources/icon-dev.png?asset' import { Store, initDataPath } from './persistence' @@ -58,26 +58,6 @@ let rateLimits: RateLimitService | null = null let runtimeRpc: OrcaRuntimeRpcServer | null = null let starNag: StarNagService | null = null -function triggerStartupMicrophoneRegistration(): void { - if (process.platform !== 'darwin') { - return - } - try { - const status = systemPreferences.getMediaAccessStatus('microphone') - if (status !== 'not-determined') { - return - } - // Why: terminal child processes (sox/ffmpeg/voice CLIs) cannot reliably - // surface the TCC dialog themselves. Prompt once from the app process after - // the window is visible so mic capture in embedded terminals can work. - void systemPreferences.askForMediaAccess('microphone').catch((error: unknown) => { - console.error('[permissions] Failed to request microphone access:', error) - }) - } catch (error) { - console.error('[permissions] Failed to check microphone access status:', error) - } -} - installUncaughtPipeErrorGuard() // Why: propagate the Orca app version into `process.env` so PTY-env // construction in both main (local-pty-provider) and the forked daemon @@ -284,7 +264,6 @@ app.whenReady().then(async () => { // window, making it impossible for the user to click "Allow". win.once('show', () => { triggerStartupNotificationRegistration(store!) - triggerStartupMicrophoneRegistration() }) app.on('activate', () => { diff --git a/src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx b/src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx index b7fcb6bcc..1ffa0cfa1 100644 --- a/src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx +++ b/src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx @@ -155,7 +155,6 @@ export function useDiffCommentDecorator({ }) disposablesRef.current = [onMouseMove, onMouseLeave, onScroll] - const zones = zonesRef.current return () => { for (const d of disposablesRef.current) { @@ -170,10 +169,10 @@ export function useDiffCommentDecorator({ // stale zone ids from a dead editor. The diff effect below deliberately // has no cleanup so comment-only changes don't cause a full zone // rebuild; this cleanup is the single place we reset zone tracking. - for (const entry of zones.values()) { + for (const entry of zonesRef.current.values()) { entry.root.unmount() } - zones.clear() + zonesRef.current.clear() } }, [editor])