Skip to content

Conversation

@handlename
Copy link
Contributor

Problem

Even when specifying the absolute path to Node.js and claude-code-acp, opening Agent Chat resulted in a Command Not Found error on macOS/Linux.

Settings Chat
image image

Cause

claude-code-acp is a Node.js script with the shebang #!/usr/bin/env node.
https://github.com/zed-industries/claude-code-acp/blob/09106474ea733ba5cc3b8f6ca3a521b6a131eed9/src/index.ts#L1

While the command itself was found via the absolute path, /usr/bin/env could not find node in PATH, resulting in exit code 127.

On macOS/Linux, commands are executed via /bin/zsh -l -c 'command' (login shell). Login shells read initialization files (.zprofile, .zshrc, etc.) which re-set PATH. As a result, modifications to env.PATH passed to spawn() were overwritten by the shell initialization process and lost.

Solution

When using a login shell on macOS/Linux with nodePath configured, we now prepend export PATH='nodeDir':"$PATH"; to the shell command. This ensures the Node directory is added to the beginning of PATH after the login shell initialization completes.

Background

OS: macOS 26.1
Obsidian: 1.10.6
Shell: fish
Node.js path: /Users/handlename/.local/share/mise/installs/node/24.8.0/bin/node (installed via mise)
claude-code-acp path: /Users/handlename/.local/share/mise/installs/node/24.8.0/bin/claude-code-acp

…/Linux

On macOS/Linux, commands are executed via login shell which re-initializes
PATH from shell config files, overwriting env.PATH passed to spawn().

Even when the agent command uses an absolute path, scripts with shebang
"#!/usr/bin/env node" require node to be in PATH for the env command.

When nodePath is configured and using login shell, we now prepend
`export PATH='nodeDir':"$PATH";` to the shell command to ensure
node is available after shell initialization completes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@RAIT-09 RAIT-09 self-requested a review December 13, 2025 07:05
@RAIT-09 RAIT-09 added the bug Something isn't working label Dec 13, 2025
@RAIT-09
Copy link
Owner

RAIT-09 commented Dec 13, 2025

Thank you for the detailed analysis and fix! The root cause explanation about login shells overwriting env.PATH was very insightful.

I've tested this on my environment and confirmed it works correctly.

Merging now. Thanks again for the contribution!

@RAIT-09 RAIT-09 merged commit 9d2dc97 into RAIT-09:master Dec 13, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants