diff --git a/mux/src/localpane.rs b/mux/src/localpane.rs index 93b901a3c..e89dedb53 100644 --- a/mux/src/localpane.rs +++ b/mux/src/localpane.rs @@ -780,7 +780,9 @@ impl LocalPane { } for child in proc.children.values() { - find_youngest(child, youngest); + if child.console != 0 { + find_youngest(child, youngest); + } } } diff --git a/procinfo/src/lib.rs b/procinfo/src/lib.rs index 9f5637466..7da56f213 100644 --- a/procinfo/src/lib.rs +++ b/procinfo/src/lib.rs @@ -31,8 +31,10 @@ pub struct LocalProcessInfo { pub argv: Vec, pub cwd: PathBuf, pub status: LocalProcessStatus, - pub children: HashMap, pub start_time: u64, + #[cfg(windows)] + pub console: u64, + pub children: HashMap, } luahelper::impl_lua_conversion!(LocalProcessInfo); diff --git a/procinfo/src/windows.rs b/procinfo/src/windows.rs index 3f5bd9100..66048548a 100644 --- a/procinfo/src/windows.rs +++ b/procinfo/src/windows.rs @@ -86,6 +86,7 @@ fn wstr_to_string(slice: &[u16]) -> String { struct ProcParams { argv: Vec, cwd: PathBuf, + console: HANDLE, } struct ProcHandle(HANDLE); @@ -220,6 +221,7 @@ impl ProcHandle { Some(ProcParams { argv: cmd_line_to_argv(&cmdline), cwd: wstr_to_path(&cwd), + console: params.ConsoleHandle, }) } @@ -243,6 +245,7 @@ impl ProcHandle { Some(ProcParams { argv: cmd_line_to_argv(&cmdline), cwd: wstr_to_path(&cwd), + console: params.ConsoleHandle as _, }) } @@ -353,6 +356,7 @@ impl LocalProcessInfo { let mut start_time = 0; let mut cwd = PathBuf::new(); let mut argv = vec![]; + let mut console = 0; if let Some(proc) = ProcHandle::new(info.th32ProcessID) { if let Some(exe) = proc.executable() { @@ -361,6 +365,7 @@ impl LocalProcessInfo { if let Some(params) = proc.get_params() { cwd = params.cwd; argv = params.argv; + console = params.console as _; } if let Some(start) = proc.start_time() { start_time = start; @@ -377,6 +382,7 @@ impl LocalProcessInfo { start_time, status: LocalProcessStatus::Run, children, + console, } }