github / github/copilot-cli

Add a /redo command after /undo or /rewind

Offen
#3,089 0 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:sessions
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by tracing the existing /undo and /rewind command implementations and how they store reverted turn and file state. Define how /redo advances through that state, when new prompts or edits clear it, and what happens when no redo step remains; done means the documented workflows restore the reverted state reliably.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.