fix: the server's own folders under a short-named temp path are expanded, not refused (#1055)

On Windows the temporary folder often has an 8.3 short name, which the path scope refuses. vfs::long_names spells folders SolidCraft derives from the environment with long names, and the MCP scratch folder and the recovery folder use it, so screenshot without a path and the recovery commands work there again.
This commit is contained in:
NOWN-DEV authored and GitHub committed 2026-10-14 09:05:43 -04:00
1 parent cf93869c4d
commit 08b6a8fe0f
10 files changed
+165 -16

No files matched your search

+1 -1
View File
@@ -589,7 +589,7 @@ fn capture(b: &mut dyn Backend, a: &Map<String, Value>) -> Result<(Vec<u8>, Valu
let keep = str_arg(a, "path").filter(|p| !p.trim().is_empty()).map(str::to_string);
let path = keep.clone().unwrap_or_else(|| {
let n = SHOT.fetch_add(1, Ordering::Relaxed);
let dir = crate::scratch_dir().unwrap_or_else(std::env::temp_dir);
let dir = crate::scratch_dir().unwrap_or_else(vfs::temp_dir);
dir.join(format!("shot-{n}.png")).to_string_lossy().to_string()
});
let window = match str_arg(a, "source") {