You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add tui.alternate_screen config and --no-alt-screen CLI flag
Fixes#2558 - Zellij users cannot scroll back due to alternate screen mode.
This adds:
- `AltScreenMode` enum with values: auto, always, never
- `tui.alternate_screen` config option (default: auto)
- `--no-alt-screen` CLI flag to force inline mode
- Auto-detection: When running in Zellij (detected via ZELLIJ env vars),
alternate screen is automatically disabled to preserve scrollback
The implementation:
- Detects Zellij using existing terminal_info() infrastructure
- In "auto" mode, skips enter_alt_screen() when in Zellij
- In "never" mode or with --no-alt-screen flag, always uses inline mode
- In "always" mode, uses alternate screen (original behavior)
# - "auto": Disable alternate screen in Zellij (which follows xterm spec and
945
+
# doesn't support scrollback in alternate screen), enable elsewhere.
946
+
# - "always": Always use alternate screen (original behavior).
947
+
# - "never": Never use alternate screen (inline mode, preserves scrollback).
948
+
#
949
+
# You can also use the --no-alt-screen CLI flag to force "never" mode.
950
+
alternate_screen = "auto"
939
951
```
940
952
941
953
> [!NOTE]
@@ -1053,6 +1065,7 @@ Valid values:
1053
1065
|`tui.scroll_wheel_tick_detect_max_ms`| number | Auto-mode threshold (ms) for promoting a stream to wheel-like behavior (default: 12). |
1054
1066
|`tui.scroll_wheel_like_max_duration_ms`| number | Auto-mode fallback duration (ms) used for 1-event-per-tick terminals (default: 200). |
1055
1067
|`tui.scroll_invert`| boolean | Invert mouse scroll direction in TUI2 (default: false). |
1068
+
|`tui.alternate_screen`|`auto`\|`always`\|`never`| Alternate screen mode in TUI2 (default: `auto`). Use `never` or `--no-alt-screen` for Zellij scrollback. |
1056
1069
|`hide_agent_reasoning`| boolean | Hide model reasoning events. |
1057
1070
|`check_for_update_on_startup`| boolean | Check for Codex updates on startup (default: true). Set to `false` only if updates are centrally managed. |
1058
1071
|`show_raw_agent_reasoning`| boolean | Show raw reasoning (when available). |
0 commit comments