[BUG] Ctrl+O file viewer uses alternate screen buffer — content not scrollable in terminal scrollback

Status Open
Reported on v2.1.288
Maintainer reply None cached
Activity 0 comments · opened Oct 4, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When pressing Ctrl+O to open a file in the built-in viewer, the content is rendered in the alternate screen buffer.
This means:

  • The terminal's scrollback history (e.g. tmux, GNOME Terminal) does not capture the content
  • Only the portion visible on screen at the moment is accessible — you cannot scroll up to see the rest of the file
  • On exit the content disappears entirely

Workaround: Use ! cat <file> in the prompt to dump file content to the main buffer where scrollback works.

Environment: Ubuntu 22.04, GNOME Terminal, tmux

What Should Happen?

Either (a) render via a pager invoked with --no-init / LESS="-X" so it stays in the main buffer, or
(b) provide a config option to choose which buffer is used.

Error Messages/Logs

Steps to Reproduce

  1. launch tmux with claude
  2. ask to generate a large file - e.g. print an integer per line for 0 through 100
  3. use ctrl+o - only the last lines that fit on the screen are visible, when scrolling up no more lines are shown

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

 2.1.288

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

So, I am running wsl on my Windows laptop to ssh into an ubuntu box where Claude is running.

View original on GitHub ↗