pub fn focus_session(pid: i32, mux_hint: Option<&str>) -> FocusResultExpand description
Focus the terminal window containing the given process.
This is the main entry point for the library. It handles:
- Multiplexer detection and pane switching (tmux, etc.)
- Terminal detection from TTY
- Terminal-specific focusing (iTerm2, Terminal.app, etc.)
- Generic window activation fallback
Uses FocusMode::SingleWindow by default (brings only the target window
to the front). Use focus_session_with_mode for explicit mode control.
§Arguments
pid- Process ID of the sessionmux_hint- Optional hint about the multiplexer type (e.g., “tmux”)
§Returns
A FocusResult indicating what happened.