Skip to content

Commit 50fa076

Browse files
authored
fix: PWD=/ when launched from finder (#352)
1 parent bb8ecab commit 50fa076

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/atuin-desktop-runtime/src/context/resolution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ impl ContextResolver {
339339
fn default_cwd() -> String {
340340
// Check for PWD env var first (set by shell, reflects current directory)
341341
// This allows CLI tools to inherit the user's current working directory
342-
// Falls back to home directory for desktop app / GUI contexts
342+
// Skip "/" as it's not useful - macOS sets PWD="/" when launching GUI apps from Finder
343343
if let Ok(pwd) = std::env::var("PWD") {
344-
if !pwd.is_empty() {
344+
if !pwd.is_empty() && pwd != "/" {
345345
return pwd;
346346
}
347347
}

0 commit comments

Comments
 (0)