Skip to content

Commit 563df10

Browse files
committed
fixed
1 parent dee8664 commit 563df10

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A terminal multiplexer for managing [OpenCode](https://opencode.ai) sessions.
1111
**Cargo:**
1212

1313
```
14-
cargo install ocmux-rs
14+
cargo install opencode-multiplexer
1515
```
1616

1717
**Homebrew:**

src/registry.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,25 @@ pub fn update_serve_registry_tui_pid(port: u16, tui_pid: u32) -> anyhow::Result<
115115
Ok(())
116116
}
117117

118+
#[cfg(unix)]
118119
fn is_pid_alive(pid: u32) -> bool {
119120
unsafe { libc::kill(pid as i32, 0) == 0 }
120121
}
121122

123+
#[cfg(windows)]
124+
fn is_pid_alive(pid: u32) -> bool {
125+
if let Ok(output) = std::process::Command::new("tasklist")
126+
.arg("/FI")
127+
.arg(format!("PID eq {}", pid))
128+
.output()
129+
{
130+
let stdout = String::from_utf8_lossy(&output.stdout);
131+
stdout.contains(&pid.to_string())
132+
} else {
133+
true
134+
}
135+
}
136+
122137
fn default_serve_registry_path() -> anyhow::Result<PathBuf> {
123138
let home = std::env::var("HOME").context("HOME is not set")?;
124139
Ok(PathBuf::from(home).join(".config/ocmux/serve-processes.json"))

0 commit comments

Comments
 (0)