github / github/copilot-cli

Allow /fork to open a new terminal and add copilot --fork

未关闭
#4,580 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

triage
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the feature or problem you'd like to solve

The interactive /fork command moves the current terminal into the fork, and Copilot CLI has no startup option for creating a fork from an existing session. This makes parallel terminal workflows unnecessarily manual.

Proposed solution

Support both of these entry points:

  1. Add copilot --fork=<session-id> --name=<new-session-name>. It should create a new fork of the supplied session, apply the optional name to the new fork, and start the fork in the process that invoked the command. The source session name should remain unchanged.
  2. Add an option such as /fork --new-terminal [name]. It should create the fork in a new terminal window or tab while the current terminal remains in the original session.

The command line option provides a portable building block when automatic terminal launching is unavailable. Users can combine it with their preferred terminal application.

If /fork --new-terminal cannot identify or launch the current terminal application, it should return the new session ID and a ready-to-run copilot --resume=<new-session-id> command instead of silently changing behavior.

Example prompts or workflows
  1. Run /fork --new-terminal investigate-auth during a task. The fork opens separately, and the original session remains visible and interactive.
  2. Run wt new-tab copilot --fork=<session-id> --name=investigate-auth to create and name a fork in a new Windows Terminal tab.
  3. Run copilot --fork=<session-id> --name=alternative-design from another shell to create, name, and enter a fork of a specific session.
  4. Run !wt new-tab copilot --fork=<session-id> --name=side-investigation inside Copilot CLI to launch the fork without abandoning the current session.
Additional context

This replaces #4578, which was submitted without the Feature Request form.

This is a focused follow-up to #2058. That issue requested the core /fork command and mentioned a new terminal window or tab in its proposed solution. The core command now exists, but terminal selection and process startup interfaces are still missing.

Related issue #1697 also describes working with forked sessions in separate terminals.

Confirmed with GitHub Copilot CLI 1.0.81-8: both copilot --fork=<session-id> and copilot --branch=<session-id> are rejected as unknown options.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从现有的交互式 /fork 命令以及 CLI 选项解析和进程启动路径开始。跟踪会话的创建和恢复方式,然后验证所要求的命令行和 /fork --new-terminal 工作流,包括备用恢复命令以及未更改的源会话名称。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
活跃
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。