Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: server-side Ctrl-C handling for Windows x86_64 targets (attempt 2)

Akarshan11db1ecaeda4
diff --git a/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs b/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
index a38b72810..0b8466ffd 100644
--- a/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
+++ b/src-tauri/src/core/utils/extensions/inference_llamacpp_extension/server.rs
@@ -201,12 +201,11 @@ pub async fn unload_llama_model(
#[cfg(all(windows, target_arch = "x86_64"))]
{
- use windows_sys::Win32::Foundation::BOOL;
use windows_sys::Win32::System::Console::{GenerateConsoleCtrlEvent, CTRL_C_EVENT};
if let Some(raw_pid) = child.id() {
log::info!("Sending Ctrl-C to PID {}", raw_pid);
- let ok: BOOL = unsafe {
+ let ok: i32 = unsafe {
GenerateConsoleCtrlEvent(CTRL_C_EVENT, raw_pid as u32)
};
if ok == 0 {