Fix OS socket routing in telemetry
This commit is contained in:
1 parent
80b1969b15
commit
8a67249ddb
1 file changed
+9
-4
@@ -18,13 +18,18 @@ pub async fn nvim_telemetry_handler(
|
||||
// 1. Update active_nvim.txt if FocusGained, BufEnter, or VimEnter
|
||||
if payload.event == "FocusGained" || payload.event == "BufEnter" || payload.event == "VimEnter"
|
||||
{
|
||||
let session = &payload.session_id;
|
||||
let is_unix_socket = session.starts_with('/') || session.starts_with('~');
|
||||
|
||||
if is_unix_socket {
|
||||
let wsl_path = "\\\\wsl.localhost\\Ubuntu\\home\\riz\\.gemini\\active_nvim.txt";
|
||||
let _ = tokio::fs::write(wsl_path, session).await;
|
||||
} else {
|
||||
let profile =
|
||||
std::env::var("USERPROFILE").unwrap_or_else(|_| "C:\\Users\\reazul.ashraf".into());
|
||||
let win_path = format!("{}\\.gemini\\active_nvim.txt", profile);
|
||||
let _ = tokio::fs::write(&win_path, &payload.session_id).await;
|
||||
|
||||
let wsl_path = "\\\\wsl.localhost\\Ubuntu\\home\\riz\\.gemini\\active_nvim.txt";
|
||||
let _ = tokio::fs::write(wsl_path, &payload.session_id).await;
|
||||
let _ = tokio::fs::write(&win_path, session).await;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Broadcast to UI WebSockets
|
||||
|
||||
Reference in new issue
Block a user