Skip to content

Commit 5e44557

Browse files
Brendonovichpanyw5
authored andcommitted
fix(desktop): start tauri shell commands from home directory (anomalyco#22535)
1 parent c3627f6 commit 5e44557

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • packages/desktop/src-tauri/src

packages/desktop/src-tauri/src/cli.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,12 @@ pub fn spawn_command(
524524
// watchdog. This avoids shell rc side effects while still killing the sidecar if the
525525
// desktop parent disappears before RunEvent::Exit can run.
526526
let mut cmd = Command::new("/bin/sh");
527+
// Start the supervisor (and therefore the sidecar) from $HOME instead of inheriting the
528+
// Tauri bundle / launcher cwd. Mirrors upstream sst/opencode#22535 so any cwd-sensitive
529+
// logic (path resolution, log placement, shell rc fallbacks) sees a sane working directory.
530+
if let Ok(home) = app.path().home_dir() {
531+
cmd.current_dir(home);
532+
}
527533
cmd.arg("-c")
528534
.arg(UNIX_SUPERVISOR)
529535
.arg("opencode-supervisor");

0 commit comments

Comments
 (0)