Writes the current context window to logs/current_context_window (uses a symlink to a session ID). This PR was unfortunately generated by a different LLM and did a ton of superficial reformating, it's actually a fairly small and benign change, but I don't want to roll back everything. Hope that's ok.
20 lines
502 B
Rust
20 lines
502 B
Rust
use sysinfo::{Pid, System};
|
|
|
|
fn main() {
|
|
let mut sys = System::new_all();
|
|
sys.refresh_processes();
|
|
|
|
// Test with known PIDs
|
|
let pids = vec![68123, 72749];
|
|
|
|
for pid_num in pids {
|
|
let pid = Pid::from_u32(pid_num);
|
|
if let Some(process) = sys.process(pid) {
|
|
println!("\nPID: {}", pid_num);
|
|
println!("Name: {}", process.name());
|
|
println!("Cmd: {:?}", process.cmd());
|
|
println!("Exe: {:?}", process.exe());
|
|
}
|
|
}
|
|
}
|