pub fn run_screen_with_log_capture(
command: &str,
session_name: &str,
user: Option<&str>,
log_path: Option<&Path>,
) -> IsolationResultExpand description
Run screen with log capture using -L flag + screenrc directives (for attached mode without TTY).
Uses a unified approach combining the -L flag with screenrc directives:
-Lflag enables logging for the initial window (available on ALL screen versions)logfile <path>in screenrc sets the log file path (replaces-LogfileCLI option)logfile flush 0forces immediate flushing (no 10-second delay)deflog onenables logging for any additional windows
Key insight: deflog on only applies to windows created AFTER screenrc processing,
but the default window is created BEFORE screenrc is processed. The -L flag is
needed to enable logging for that initial window.
This replaces the previous version-dependent approach that used:
-L -Logfilefor screen >= 4.5.1 (native logging)teefallback for screen < 4.5.1 (e.g., macOS bundled 4.0.3)