Use login shell to start aish
in sidecar pane to inherit proper environment PATH
#403
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
On macOS, when using the sidecar experience,
aish
cannot start local MCP servers and theAzure
agent cannot get the access token from Az CLI.This is due to the PATH environment variable not properly setup when iTerm2 starts
"aish --Channel ..."
in the new pane. iTerm2 usesexec
to run theaish
command, which directly execute the program without setting up the environment variables properly.Because of that, the
az
andpwsh
commands cannot be found when retrieving access token, and the MCP server commands cannot be found too, which caused local MCP servers to always fail to start.The fix is to wrap it with
zsh
by/bin/zsh -l -c "<aish-path> --channel <channel-string>"
. In this way,zsh
will set up the environment properly, which will then be inherited byaish
.This also fixes #380. After using the shell wrapper, I can no longer reproduce this issue. It's possibly because the shell wrapper makes it slower to get to the selection rendering code, which magically avoid the race condition.