Skip to main content

resolve_term_option

Function resolve_term_option 

Source
pub fn resolve_term_option(
    term_override: Option<&str>,
    cwd: &Path,
) -> Result<(LaunchMethod, Option<String>)>
Expand description

Resolve a launch method honoring an optional CLI override.

Resolution order:

  1. term_override (the -T/--term CLI flag), if Some — parsed via parse_term_option, so it understands aliases and the method:session-name syntax.
  2. CW_LAUNCH_METHOD env var.
  3. .cwconfig.json (repo-local) launch.method.
  4. global ~/.config/git-worktree-manager/config.json launch.method.
  5. LaunchMethod::Foreground (the default).

Returns (method, session_name) where session_name is Some only when the override used the method:session-name syntax (env / config paths can’t carry a session name today).