fix: replace unsafe env::set_var with thread-safe OnceLock

Resolves intermittent STATUS_HEAP_CORRUPTION on Windows by using a static OnceLock map instead of mutating the global OS environment block.
This commit is contained in:
Riz Ashraf committed 2026-10-11 06:56:24 +01:00
1 parent 3533c243d2
commit ffb316a6e3
12 files changed
+235 -52

No files matched your search

+1 -1
View File
@@ -146,7 +146,7 @@ pub async fn nvim_telemetry_handler(
let _ = tokio::fs::write(wsl_path, session).await;
} else {
let profile =
std::env::var("USERPROFILE").unwrap_or_else(|_| "C:\\Users\\reazul.ashraf".into());
crate::config::get_env("USERPROFILE").unwrap_or_else(|_| "C:\\Users\\reazul.ashraf".into());
let win_path = format!("{}\\.gemini\\active_nvim.txt", profile);
let _ = tokio::fs::write(&win_path, session).await;
}