github / github/copilot-cli

Add a /redo command after /undo or /rewind

未关闭
#3,089 0 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
area:sessions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

`/undo` and `/rewind` are documented, but there is no documented way to redo after rewinding too far. If a user accidentally undoes one turn too many, they have to recover by manually reconstructing state from session history, editor local history, git history, or by rerunning the original prompt.

### Proposed solution

Add a complementary `/redo` command that steps forward through the rewind stack created by `/undo` and `/rewind`, restoring the reverted turn and its file changes until a new action invalidates the redo stack. This would make rewind safer to use, reduce accidental loss of work, and align with common editor and terminal expectations.

### Example prompts or workflows

1. Use `/undo` to inspect the state before the last turn, realize it was one step too far, then run `/redo` to restore that turn.
2. Rewind several turns while comparing alternative outputs, then step forward one turn at a time with `/redo`.
3. Accidentally use `/undo` twice, then recover without needing `/resume`, session history, or rerunning the original prompt.
4. Use `/undo` after a broad code change, confirm the change was actually desired, then `/redo` to restore it intact.

### Additional context

A standard undo/redo stack would be a good fit:
- `/redo` should only be available immediately after `/undo` or `/rewind`.
- Any new user prompt, edit, or state-changing command could clear the redo stack.
- If a full session-state restore is too expensive, even a best-effort redo for turn and file state would materially improve the UX.

贡献指南

打开贡献指南

调研方向

首先跟踪现有的 /undo 和 /rewind 命令实现,以及它们如何存储已撤销回合和文件的状态。定义 /redo 如何推进该状态、新的 prompt 或编辑何时清除该状态,以及没有剩余 redo 步骤时会发生什么;当文档化的工作流能够可靠地恢复已撤销状态时,即视为完成。

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

评估

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

把新 issue 发到你的邮箱

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