diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs index d9f08c2247..a900d0114b 100644 --- a/crates/gpui/src/platform/windows/platform.rs +++ b/crates/gpui/src/platform/windows/platform.rs @@ -664,10 +664,11 @@ fn file_save_dialog(directory: PathBuf) -> Result> { let dialog: IFileSaveDialog = unsafe { CoCreateInstance(&FileSaveDialog, None, CLSCTX_ALL)? }; if !directory.to_string_lossy().is_empty() { if let Some(full_path) = directory.canonicalize().log_err() { - let full_path = full_path.to_string_lossy().to_string(); - if !full_path.is_empty() { + let full_path = full_path.to_string_lossy(); + let full_path_str = full_path.trim_start_matches("\\\\?\\"); + if !full_path_str.is_empty() { let path_item: IShellItem = - unsafe { SHCreateItemFromParsingName(&HSTRING::from(&full_path), None)? }; + unsafe { SHCreateItemFromParsingName(&HSTRING::from(full_path_str), None)? }; unsafe { dialog.SetFolder(&path_item).log_err() }; } }