github / github/copilot-cli

Add a /redo command after /undo or /rewind

Aperta
#3,089 0 commenti 5 reazioni 0 assegnatari Vedi su GitHub
area:sessions
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.