@@ -341,9 +341,13 @@ export class ClaudeAcpAgent implements Agent {
341341 allowDangerouslySkipPermissions : ! IS_ROOT ,
342342 permissionMode,
343343 canUseTool : this . canUseTool ( sessionId ) ,
344- // note: although not documented by the types, passing an absolute path
345- // here works to find zed's managed node version.
346- executable : process . execPath as any ,
344+ // Use "node" to resolve via PATH where a symlink to Electron exists.
345+ // This avoids launching the Electron binary directly from the app bundle,
346+ // which can cause dock icons to appear on macOS even with ELECTRON_RUN_AS_NODE.
347+ executable : "node" ,
348+ // Prevent spawned Electron processes from showing in dock/tray.
349+ // Must merge with process.env since SDK replaces rather than merges.
350+ env : { ...process . env , ELECTRON_RUN_AS_NODE : "1" } ,
347351 ...( process . env . CLAUDE_CODE_EXECUTABLE && {
348352 pathToClaudeCodeExecutable : process . env . CLAUDE_CODE_EXECUTABLE ,
349353 } ) ,
@@ -986,7 +990,13 @@ export class ClaudeAcpAgent implements Agent {
986990 permissionMode,
987991 canUseTool : this . canUseTool ( sessionId ) ,
988992 stderr : ( err ) => this . logger . error ( err ) ,
989- executable : process . execPath as any ,
993+ // Use "node" to resolve via PATH where a symlink to Electron exists.
994+ // This avoids launching the Electron binary directly from the app bundle,
995+ // which can cause dock icons to appear on macOS even with ELECTRON_RUN_AS_NODE.
996+ executable : "node" ,
997+ // Prevent spawned Electron processes from showing in dock/tray.
998+ // Must merge with process.env since SDK replaces rather than merges.
999+ env : { ...process . env , ELECTRON_RUN_AS_NODE : "1" } ,
9901000 ...( process . env . CLAUDE_CODE_EXECUTABLE && {
9911001 pathToClaudeCodeExecutable : process . env . CLAUDE_CODE_EXECUTABLE ,
9921002 } ) ,
0 commit comments