mirror of
https://github.com/openai/codex.git
synced 2026-12-05 01:00:54 +00:00
Enable the fullscreen transcript by default (#47178)
## What changed Default `tui.fullscreen_transcript` to `true`, including when the `[tui]` section is absent, and apply the same default to the first frame. Update the configuration schema to match. Alternate-screen restrictions still take precedence, and `tui.fullscreen_transcript=false` restores terminal scrollback. ## Testing Update configuration and startup tests for the new default, including an empty `[tui]` section and `--no-alt-screen`. Adjust PTY tests to cover default fullscreen entry and explicit opt-out to terminal scrollback. GitOrigin-RevId: e460dcd058d52c50da2abc5113bbb678e845d5fc
This commit is contained in:
@@ -799,8 +799,8 @@ pub struct Tui {
|
||||
pub raw_output_mode: bool,
|
||||
|
||||
/// Own the fullscreen transcript, including scrolling, selection, and search.
|
||||
/// Defaults to `false`; alternate-screen restrictions take precedence.
|
||||
#[serde(default)]
|
||||
/// Defaults to `true`; alternate-screen restrictions take precedence.
|
||||
#[serde(default = "default_true")]
|
||||
pub fullscreen_transcript: bool,
|
||||
|
||||
/// Controls whether the TUI uses the terminal's alternate screen buffer.
|
||||
|
||||
@@ -4254,8 +4254,8 @@
|
||||
"description": "Individual visual effects. Each also requires animations to be enabled."
|
||||
},
|
||||
"fullscreen_transcript": {
|
||||
"default": false,
|
||||
"description": "Own the fullscreen transcript, including scrolling, selection, and search. Defaults to `false`; alternate-screen restrictions take precedence.",
|
||||
"default": true,
|
||||
"description": "Own the fullscreen transcript, including scrolling, selection, and search. Defaults to `true`; alternate-screen restrictions take precedence.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"keymap": {
|
||||
|
||||
@@ -1262,7 +1262,7 @@ fn config_toml_deserializes_model_availability_nux() {
|
||||
vim_mode_default: false,
|
||||
question_esc_back: true,
|
||||
raw_output_mode: false,
|
||||
fullscreen_transcript: false,
|
||||
fullscreen_transcript: true,
|
||||
alternate_screen: AltScreenMode::default(),
|
||||
status_line: None,
|
||||
status_line_use_colors: true,
|
||||
@@ -4392,7 +4392,7 @@ fn tui_config_missing_notifications_field_defaults_to_enabled() {
|
||||
vim_mode_default: false,
|
||||
question_esc_back: true,
|
||||
raw_output_mode: false,
|
||||
fullscreen_transcript: false,
|
||||
fullscreen_transcript: true,
|
||||
alternate_screen: AltScreenMode::Auto,
|
||||
status_line: None,
|
||||
status_line_use_colors: true,
|
||||
|
||||
@@ -4436,7 +4436,7 @@ impl Config {
|
||||
tui_fullscreen_transcript: cfg
|
||||
.tui
|
||||
.as_ref()
|
||||
.is_some_and(|tui| tui.fullscreen_transcript),
|
||||
.is_none_or(|tui| tui.fullscreen_transcript),
|
||||
tui_alternate_screen: cfg
|
||||
.tui
|
||||
.as_ref()
|
||||
|
||||
@@ -61,7 +61,7 @@ pub(super) async fn load(
|
||||
config_toml
|
||||
.tui
|
||||
.as_ref()
|
||||
.is_some_and(|tui| tui.fullscreen_transcript),
|
||||
.is_none_or(|tui| tui.fullscreen_transcript),
|
||||
use_alt_screen,
|
||||
);
|
||||
let status_line_enabled = config_toml
|
||||
|
||||
@@ -50,7 +50,9 @@ async fn selected_profile_controls_submit_before_the_first_frame() -> anyhow::Re
|
||||
async fn first_frame_respects_screen_and_status_line_overrides() -> anyhow::Result<()> {
|
||||
let home = tempfile::tempdir()?;
|
||||
for (config, args, expected) in [
|
||||
("", vec!["codex"], (true, false, true)),
|
||||
("", vec!["codex"], (true, true, true)),
|
||||
("[tui]\n", vec!["codex"], (true, true, true)),
|
||||
("", vec!["codex", "--no-alt-screen"], (false, false, true)),
|
||||
(
|
||||
"[tui]\nfullscreen_transcript = true\n",
|
||||
vec!["codex"],
|
||||
|
||||
@@ -157,15 +157,11 @@ async fn interactive_startup_honors_codex_home_symlink_opt_out() -> Result<()> {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn owned_screen_entry_paints_before_sync_ends_and_exit_clears_inline_draft() -> Result<()> {
|
||||
fn default_owned_screen_entry_paints_before_sync_ends_and_exit_clears_inline_draft() -> Result<()> {
|
||||
let repo_root = codex_utils_cargo_bin::repo_root()?;
|
||||
let codex_home = tempfile::tempdir()?;
|
||||
write_test_config(codex_home.path(), &repo_root)?;
|
||||
let mut terminal = PtyCodex::start(
|
||||
&repo_root,
|
||||
codex_home,
|
||||
&["-c", "tui.fullscreen_transcript=true"],
|
||||
)?;
|
||||
let mut terminal = PtyCodex::start(&repo_root, codex_home, &[])?;
|
||||
terminal.wait_for_startup()?;
|
||||
let deadline = Instant::now() + STARTUP_TIMEOUT;
|
||||
while !terminal.parser.screen().alternate_screen() && Instant::now() < deadline {
|
||||
@@ -255,11 +251,15 @@ fn owned_screen_entry_paints_before_sync_ends_and_exit_clears_inline_draft() ->
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fullscreen_transcript_defaults_to_terminal_scrollback() -> Result<()> {
|
||||
fn fullscreen_transcript_can_opt_out_to_terminal_scrollback() -> Result<()> {
|
||||
let repo_root = codex_utils_cargo_bin::repo_root()?;
|
||||
let codex_home = tempfile::tempdir()?;
|
||||
write_test_config(codex_home.path(), &repo_root)?;
|
||||
let mut terminal = PtyCodex::start(&repo_root, codex_home, &[])?;
|
||||
let mut terminal = PtyCodex::start(
|
||||
&repo_root,
|
||||
codex_home,
|
||||
&["-c", "tui.fullscreen_transcript=false"],
|
||||
)?;
|
||||
terminal.wait_for_startup()?;
|
||||
terminal.wait_for_screen("GPT-5.6-Terra")?;
|
||||
ensure!(
|
||||
@@ -267,7 +267,7 @@ fn fullscreen_transcript_defaults_to_terminal_scrollback() -> Result<()> {
|
||||
.output
|
||||
.windows(b"\x1b[?1049h".len())
|
||||
.any(|bytes| bytes == b"\x1b[?1049h"),
|
||||
"default launch entered the alternate screen"
|
||||
"fullscreen opt-out entered the alternate screen"
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user