Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: wd on windows (#1433)

tribhuwan1c4160d64c19
diff --git a/screenpipe-app-tauri/src-tauri/src/sidecar.rs b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
index 373639388..dedb79207 100644
--- a/screenpipe-app-tauri/src-tauri/src/sidecar.rs
+++ b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
@@ -118,19 +118,6 @@ pub async fn stop_screenpipe(
.creation_flags(CREATE_NO_WINDOW)
.output()
.await;
-
- // fallback wild kill
- tokio::process::Command::new("powershell")
- .arg("-NoProfile")
- .arg("-WindowStyle")
- .arg("hidden")
- .arg("-Command")
- .arg(format!(
- r#"Get-WmiObject Win32_Process | Where-Object {{ $_.CommandLine -like "*screenpipe*" }} | ForEach-Object {{ taskkill.exe /T /F /PID $_.ProcessId }}"#,
- ))
- .creation_flags(CREATE_NO_WINDOW)
- .output()
- .await
}
}
.await;
diff --git a/screenpipe-core/src/pipes.rs b/screenpipe-core/src/pipes.rs
index 4a342ce04..d4a2b1355 100644
--- a/screenpipe-core/src/pipes.rs
+++ b/screenpipe-core/src/pipes.rs
@@ -119,15 +119,15 @@ while ($true) {{
# Add the main process to the list
$allProcesses = @($childPid) + $children
- foreach ($pid in $allProcesses) {{
+ foreach ($processId in $allProcesses) {{
try {{
- Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
+ Stop-Process -Id $processId -Force -ErrorAction SilentlyContinue
Write-Host "Stopped process: $pid"
}} catch {{
- Write-Host "Process $pid already terminated"
+ Write-Host "Process $processId already terminated"
}}
}}
-
+ Stop-Process -Id $PID -Force
exit
}}
}}