You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opencode Desktop error with nushell as default shell #8716
When I start the desktop version of Opencode, I receive this message: Error: Failed to spawn OpenCode Server. Logs:
[STDERR] Error: nu::parser::parse_mismatch
[STDERR]
[STDERR] x Parse mismatch during operation.
[STDERR] ,-[source:1:58]
[STDERR] 1 | "/Applications/OpenCode.app/Contents/MacOS/opencode-cli" serve --port 53854
[STDERR] : ^^|^^
[STDERR] : -- expected operator [STDERR] ----
[STDERR]
I've hit the same issue on NixOS with nushell as $SHELL.
The root cause is in packages/desktop/src-tauri/src/cli.rs — the spawn_command function wraps the sidecar invocation in $SHELL -il -c "..." on Unix, but nushell doesn't support combining --login with -c/--commands (it silently exits with code 1).
There's already a partial nushell workaround (the shell.ends_with("/nu") branch that adds ^ for external command syntax), but it still passes -il to nushell, which doesn't help.
However, I don't think spawning through the user's shell is necessary at all. The sidecar path is absolute, and the Windows (non-WSL) branch already invokes it directly:
// Windows non-WSL (lines 302-310) — already works finelet sidecar = get_sidecar_path(app);letmut cmd = Command::new(sidecar);
cmd.args(args.split_whitespace());
The fix would be to do the same on Unix — drop the $SHELL -il -c wrapper entirely:
This removes the dependency on $SHELL being POSIX-compatible and eliminates potential issues with other non-standard shells (nushell, fish edge cases, etc.). The get_user_shell() function can then be removed as dead code.
Happy to open a PR if this approach seems reasonable.
PS: OpenCode acutally wrote this message on its own initiative without even asking my permission...however it reflects what I think. Unless there is a good reason which I can't see on why it has been done like that.
Starting it with SHELL=/run/current-system/sw/bin/bash OpenCode is workaround that seems to work.
Activity
aciceri commentedon Feb 20, 2026
I've hit the same issue on NixOS with nushell as
$SHELL.The root cause is in
packages/desktop/src-tauri/src/cli.rs— thespawn_commandfunction wraps the sidecar invocation in$SHELL -il -c "..."on Unix, but nushell doesn't support combining--loginwith-c/--commands(it silently exits with code 1).There's already a partial nushell workaround (the
shell.ends_with("/nu")branch that adds^for external command syntax), but it still passes-ilto nushell, which doesn't help.However, I don't think spawning through the user's shell is necessary at all. The sidecar path is absolute, and the Windows (non-WSL) branch already invokes it directly:
The fix would be to do the same on Unix — drop the
$SHELL -il -cwrapper entirely:This removes the dependency on
$SHELLbeing POSIX-compatible and eliminates potential issues with other non-standard shells (nushell, fish edge cases, etc.). Theget_user_shell()function can then be removed as dead code.Happy to open a PR if this approach seems reasonable.
PS: OpenCode acutally wrote this message on its own initiative without even asking my permission...however it reflects what I think. Unless there is a good reason which I can't see on why it has been done like that.
Starting it with
SHELL=/run/current-system/sw/bin/bash OpenCodeis workaround that seems to work.github-actions commentedon Apr 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.