Scrollback in Zellij Pane Broken for OpenCode, But Works for Claude Code #1990

Closed
opened 2026-02-16 17:33:37 -05:00 by yindo · 3 comments
Owner

Originally created by @endlessblink on GitHub (Oct 7, 2025).

Describe the bug

When running AI code assistants in Zellij (e.g., Codex, OpenCode, Claude Code, etc), I’m unable to scroll up and down in the scrollback buffer when using OpenCode. However, this works correctly for Claude Code’s terminal output. In OpenCode sessions, attempting to scroll does not reveal previous output as expected. Claude Code does allow full Zellij scrollback, so the bug is likely due to differences in how OpenCode manages terminal output or buffer modes.

Steps to reproduce

Launch Zellij. Open a pane and start OpenCode (with output heavy commands).
Attempt to scroll back using Zellij’s scroll/copy mode or the mouse.
Repeat with Claude Code in a separate pane for comparison.

Expected behavior

Output from both apps should be scrollable in Zellij’s scrollback buffer using the standard scroll/copy mode, PgUp/PgDn, and mouse wheel.
Actual behavior
OpenCode output is not accessible in scrollback; scrolling fails or is incomplete.
Claude Code output is fully accessible in the scrollback buffer.

Environment

OS: WSL 2 on Windows 11
Zellij Version: zellij 0.42.2

Additional Context

This issue affects productivity when using Zellij with OpenCode. It occurs even after enabling mouse mode in Zellij and using scroll/copy shortcuts. Suspect this may be related to use of alternate screen buffer or specific terminal escape sequences in OpenCode.

Originally created by @endlessblink on GitHub (Oct 7, 2025). ## Describe the bug When running AI code assistants in Zellij (e.g., Codex, OpenCode, Claude Code, etc), I’m unable to scroll up and down in the scrollback buffer when using OpenCode. However, this works correctly for Claude Code’s terminal output. In OpenCode sessions, attempting to scroll does not reveal previous output as expected. Claude Code does allow full Zellij scrollback, so the bug is likely due to differences in how OpenCode manages terminal output or buffer modes. ## Steps to reproduce Launch Zellij. Open a pane and start OpenCode (with output heavy commands). Attempt to scroll back using Zellij’s scroll/copy mode or the mouse. Repeat with Claude Code in a separate pane for comparison. ## Expected behavior Output from both apps should be scrollable in Zellij’s scrollback buffer using the standard scroll/copy mode, PgUp/PgDn, and mouse wheel. Actual behavior OpenCode output is not accessible in scrollback; scrolling fails or is incomplete. Claude Code output is fully accessible in the scrollback buffer. ## Environment OS: WSL 2 on Windows 11 Zellij Version: zellij 0.42.2 ## Additional Context This issue affects productivity when using Zellij with OpenCode. It occurs even after enabling mouse mode in Zellij and using scroll/copy shortcuts. Suspect this may be related to use of alternate screen buffer or specific terminal escape sequences in OpenCode.
yindo closed this issue 2026-02-16 17:33:37 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 7, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #106: Requests option to not use alternate (fullscreen) screen mode - directly addresses the root cause of scrollback issues in terminal multiplexers
  • #391: Similar Zellij integration problem where closing opencode breaks keyboard input - indicates broader terminal state management issues
  • #535: Arrow keys issue in Zellij after closing opencode - related terminal state corruption problems
  • #2470: Terminal unusability after exiting in Zellij - similar terminal state management issue

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 7, 2025): This issue might be a duplicate of existing issues. Please check: - #106: Requests option to not use alternate (fullscreen) screen mode - directly addresses the root cause of scrollback issues in terminal multiplexers - #391: Similar Zellij integration problem where closing opencode breaks keyboard input - indicates broader terminal state management issues - #535: Arrow keys issue in Zellij after closing opencode - related terminal state corruption problems - #2470: Terminal unusability after exiting in Zellij - similar terminal state management issue Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 7, 2025):

believe this is because opencode is a tui and claude code isn't

@rekram1-node commented on GitHub (Oct 7, 2025): believe this is because opencode is a tui and claude code isn't
Author
Owner

@rekram1-node commented on GitHub (Oct 7, 2025):

You can read more about this in https://github.com/sst/opencode/issues/106#issuecomment-2973134511 but I am going to close this because it isn't a bug.

@rekram1-node commented on GitHub (Oct 7, 2025): You can read more about this in https://github.com/sst/opencode/issues/106#issuecomment-2973134511 but I am going to close this because it isn't a bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1990