From e9b504c73348cfe6f5beccc6472ffa04df96ac1e Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Wed, 25 Mar 2026 01:29:38 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20SFTP=20browser=20=E2=80=94=20default=20t?= =?UTF-8?q?o=20/=20instead=20of=20/home,=20strip=20quotes=20from=20CWD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /home doesn't exist on macOS (home dirs are /Users/). Changed default SFTP path to / so it always loads. OSC 7 parser now strips stray quotes from shell printf output that produced paths like /"/path". Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/src/ssh/session.rs | 5 ++++- src/composables/useSftp.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/ssh/session.rs b/src-tauri/src/ssh/session.rs index 5db31dc..be45a28 100644 --- a/src-tauri/src/ssh/session.rs +++ b/src-tauri/src/ssh/session.rs @@ -389,7 +389,10 @@ fn extract_osc7_cwd(data: &[u8]) -> Option { None } else { // URL-decode the path (spaces encoded as %20, etc.) - Some(percent_decode(path)) + // Strip any stray quotes from shell printf output + let decoded = percent_decode(path); + let clean = decoded.trim_matches('"').trim_matches('\'').to_string(); + if clean.is_empty() { None } else { Some(clean) } } } diff --git a/src/composables/useSftp.ts b/src/composables/useSftp.ts index 30c548b..cf2c2bf 100644 --- a/src/composables/useSftp.ts +++ b/src/composables/useSftp.ts @@ -93,8 +93,8 @@ export function useSftp(sessionIdRef: Ref): UseSftpReturn { currentSessionId = sessionId; - // Restore saved path or default to /home - const savedPath = sessionPaths[sessionId] || "/home"; + // Restore saved path or default to root + const savedPath = sessionPaths[sessionId] || "/"; currentPath.value = savedPath; // Load the directory