Add file undo option to backtrack mode (Ctrl+Enter)

Resolved 💬 1 comment Opened Jan 16, 2026 by huynhbaoking112 Closed Feb 12, 2026

I have a working implementation ready that modifies app_backtrack.rs in both codex-tui and codex-tui2.

Currently, the backtrack feature (Esc → Esc → Enter) only rolls back the conversation history but does not revert file changes made by the agent. This means users have to manually undo file modifications after backtracking, which breaks the workflow.

I propose adding a new keybinding Ctrl+Enter in backtrack preview mode that:

  1. Rolls back the conversation history (existing behavior)
  2. Also reverts file changes by triggering Op::Undo (using the existing ghost commit/undo infrastructure)

This gives users two options when backtracking:

  • Enter - Rollback conversation only (keep file changes)
  • Ctrl+Enter - Rollback conversation AND revert file changes

This feature leverages the existing undo feature (ghost commits) that's already implemented in codex-core, making the implementation minimal and non-invasive.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗