Add open command to resume a session by ID#193
Merged
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, orpane. When omitted it uses the configured default launch mode.inplaceruns 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
handleArgsalongside the other early-exit subcommands, and added to the usage text and the bash, zsh, and powershell completion lists.Closes #189