Skip to content

New session (/new) always prompts for working directory, even when --working-dir was set #4039

Description

@steilerDev

Problem
When docker-agent is launched with --working-dir <path>, that path is only applied to the initial session. Every subsequent new session — via /new or the "+" tab button — unconditionally opens the "New Session: Select Working Directory" picker (handleSpawnSession("") in pkg/tui/tui.go), even though the user has already told the process which directory they want to work in.

For workflows that open many sessions but always want the same working directory, this means re-selecting the same path every single time — a needless extra keystroke/interaction multiplied across every new session in a run.

Proposed fix
One of:

  1. Default /new (and the "+" button) to the working directory passed via --working-dir at launch, instead of always prompting, or
  2. Introduce a new env var (e.g. CAGENT_DEFAULT_WORKING_DIR or similar) that new sessions fall back to when set, skipping the picker.

Either would let users who consistently work in one directory skip the picker on every new session, while leaving the picker as the default for anyone who didn't set --working-dir/the env var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliCLI commands, flags, output formattingarea/sessionsFor features/issues/fixes related to session lifecycle (resume, persistence, export)area/tuiFor features/issues/fixes related to the TUI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions