Skip to content

feat(tui): add raw scrollback mode#20819

Merged
fcoury-oai merged 1 commit intomainfrom
codex/raw-scrollback-mode
May 5, 2026
Merged

feat(tui): add raw scrollback mode#20819
fcoury-oai merged 1 commit intomainfrom
codex/raw-scrollback-mode

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented May 2, 2026

Why

Granular copy is particularly difficult with the current output. Part of it was solved with the introduction of the /copy command but when you only need to copy parts of a response, you still encounter some issues:

  • When you copy a paragraph, the result is a sequence of separate lines instead of one correctly joined paragraph.
  • When a word wraps, part of it stays on the original line and the rest appears at the start of the next line.
  • When you copy a long command, extra line breaks are often inserted, and command arguments can be split across multiple lines.
rawmode_75.mp4

Solution

Now that we own the scrollback and we re-create it when we resize, we have the opportunity of toggling between the raw text and the rich text we see today.

  • Add TUI raw scrollback mode with tui.raw_output_mode, /raw [on|off], and the configurable tui.keymap.global.toggle_raw_output action.
  • Render transcript cells through rich/raw-aware paths so raw mode preserves source text and lets the terminal soft-wrap selection-friendly output.
  • Bind raw-mode toggle to alt-r by default, with the keybinding path toggling silently while /raw continues to emit confirmation messages.

Related Issues

Likely addressed by raw mode:

Partially or conditionally addressed:

Validation

  • just write-config-schema
  • just fmt
  • cargo test -p codex-config
  • cargo test -p codex-tui
  • just fix -p codex-tui
  • just argument-comment-lint
  • cargo test -p codex-tui raw_output_mode_can_change_without_inserting_notice -- --nocapture
  • cargo test -p codex-tui raw_slash_command_toggles_and_accepts_on_off_args -- --nocapture
  • cargo test -p codex-tui raw_output_toggle -- --nocapture
  • git diff --check
  • cargo insta pending-snapshots

@fcoury-oai fcoury-oai force-pushed the codex/raw-scrollback-mode branch from c1c8a22 to 860bf62 Compare May 4, 2026 20:41
@canvrno-oai
Copy link
Copy Markdown
Contributor

Tested raw scrollback mode by toggling it on and off during streaming, resizing the terminal including narrow widths, and viewing markdown-heavy output with lists and paragraphs.

@fcoury-oai fcoury-oai merged commit 5e0a4ad into main May 5, 2026
26 checks passed
@fcoury-oai fcoury-oai deleted the codex/raw-scrollback-mode branch May 5, 2026 18:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants