merge: sync upstream/main into fork main (v0.15.2)

This commit is contained in:
leeguooooo
2026-03-03 09:57:17 +09:00
41 changed files with 1615 additions and 1505 deletions
+7 -1
View File
@@ -159,7 +159,13 @@ fn is_daemon_running(session: &str) -> bool {
if let Ok(pid_str) = fs::read_to_string(&pid_path) {
if let Ok(pid) = pid_str.trim().parse::<i32>() {
unsafe {
return libc::kill(pid, 0) == 0;
if libc::kill(pid, 0) == 0 {
return true;
}
// EPERM means the process exists but we lack permission to
// signal it (e.g. inside a macOS sandbox). Only ESRCH means
// the process is genuinely gone.
return std::io::Error::last_os_error().raw_os_error() != Some(libc::ESRCH);
}
}
}
+5 -1
View File
@@ -72,7 +72,11 @@ fn run_session(args: &[String], session: &str, json_mode: bool) {
if let Ok(pid_str) = fs::read_to_string(&pid_path) {
if let Ok(pid) = pid_str.trim().parse::<u32>() {
#[cfg(unix)]
let running = unsafe { libc::kill(pid as i32, 0) == 0 };
let running = unsafe {
libc::kill(pid as i32, 0) == 0
|| std::io::Error::last_os_error().raw_os_error()
!= Some(libc::ESRCH)
};
#[cfg(windows)]
let running = unsafe {
let handle =
+12 -4
View File
@@ -344,10 +344,14 @@ pub fn print_response_with_opts(resp: &Response, action: Option<&str>, opts: &Ou
}
return;
}
// Cleared requests
// Cleared (cookies or request log)
if let Some(cleared) = data.get("cleared").and_then(|v| v.as_bool()) {
if cleared {
println!("{} Request log cleared", color::success_indicator());
let label = match action {
Some("cookies_clear") => "Cookies cleared",
_ => "Request log cleared",
};
println!("{} {}", color::success_indicator(), label);
return;
}
}
@@ -408,9 +412,13 @@ pub fn print_response_with_opts(resp: &Response, action: Option<&str>, opts: &Ou
}
return;
}
// Closed
// Closed (browser or tab)
if data.get("closed").is_some() {
println!("{} Browser closed", color::success_indicator());
let label = match action {
Some("tab_close") => "Tab closed",
_ => "Browser closed",
};
println!("{} {}", color::success_indicator(), label);
return;
}
// Recording start (has "started" field)