Skip to content

Add open command to resume a session by ID#193

Merged
jongio merged 3 commits into
mainfrom
idea/open-command
Jul 3, 2026
Merged

Add open command to resume a session by ID#193
jongio merged 3 commits into
mainfrom
idea/open-command

Conversation

@jongio

@jongio jongio commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Adds a non-interactive dispatch open <id> subcommand so you can resume a stored session straight from the shell without opening the TUI first.

What it does

  • dispatch open <id> resumes the session with that ID using the same launch path the TUI uses.
  • --mode (or -m) selects how it launches: inplace, tab, window, or pane. When omitted it uses the configured default launch mode.
  • inplace runs the Copilot CLI in the current terminal and waits for it to exit. The other modes delegate to the platform launcher, matching TUI launch behavior.

Why

Scripts, shell aliases, and editor tasks often know the exact session ID already. Today the only way to resume is to open the TUI, search, and press enter. A headless command makes those flows one step.

Notes

  • Wired into handleArgs alongside the other early-exit subcommands, and added to the usage text and the bash, zsh, and powershell completion lists.
  • Errors clearly when the ID is missing, unknown, or when more than one positional argument is passed.
  • Tests cover argument parsing, mode normalization, mode resolution, launch-style mapping, and the not-found and lookup-error paths.

Closes #189

Adds a non-interactive 'dispatch open <id>' subcommand that resumes a stored session without entering the TUI. Supports --mode to pick inplace, tab, window, or pane, and falls back to the configured default launch mode.

Closes #189

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio self-assigned this Jul 2, 2026
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 2, 2026
jongio and others added 2 commits July 2, 2026 18:37
Resolve conflicts in cmd/dispatch/cli.go by keeping both the open and
stats subcommands and taking the union of the shell-completion command
lists (help version open doctor update completion stats).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
golangci-lint's predeclared check flagged the test variable `cap` in
open_test.go for shadowing the builtin cap(); rename it to `capture`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio
jongio merged commit 39add1f into main Jul 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a non-interactive open command to resume a session by ID

1 participant