Skip to main content

find_active_loop

Function find_active_loop 

Source
pub fn find_active_loop(
    base_dir: &Path,
    session_id: Option<&str>,
) -> Option<PathBuf>
Expand description

Find the active RLCR loop directory.

Matches loop-common.sh find_active_loop behavior exactly:

  • Without session filter: only check the single newest directory (zombie-loop protection)
  • With session filter: iterate newest-to-oldest, find first matching session
  • Empty stored session_id matches any filter (backward compatibility)
  • Only return if still active (has active state file, not terminal)