Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Enable the fullscreen transcript by default (#47178)

Eric Traut5106a5234ff1
diff --git a/codex-rs/config/src/types.rs b/codex-rs/config/src/types.rs
index 96a0222d6b..b2cad6b4cd 100644
--- a/codex-rs/config/src/types.rs
+++ b/codex-rs/config/src/types.rs
@@ -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.
diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json
index e7f0c2cfc2..db13f2ac85 100644
--- a/codex-rs/core/config.schema.json
+++ b/codex-rs/core/config.schema.json
@@ -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": {
diff --git a/codex-rs/core/src/config/config_tests.rs b/codex-rs/core/src/config/config_tests.rs
index 422b01c12d..9440ba9eac 100644
--- a/codex-rs/core/src/config/config_tests.rs
+++ b/codex-rs/core/src/config/config_tests.rs
@@ -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,
diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rs
index 7d3297944c..60971edda8 100644
--- a/codex-rs/core/src/config/mod.rs
+++ b/codex-rs/core/src/config/mod.rs
@@ -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()
diff --git a/codex-rs/tui/src/startup_presentation.rs b/codex-rs/tui/src/startup_presentation.rs
index f332ef09c1..f1c917ff18 100644
--- a/codex-rs/tui/src/startup_presentation.rs
+++ b/codex-rs/tui/src/startup_presentation.rs
@@ -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
diff --git a/codex-rs/tui/src/startup_presentation_tests.rs b/codex-rs/tui/src/startup_presentation_tests.rs
index b1cc9157f2..eb3efc60c7 100644
--- a/codex-rs/tui/src/startup_presentation_tests.rs
+++ b/codex-rs/tui/src/startup_presentation_tests.rs
@@ -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"],
diff --git a/codex-rs/tui/tests/suite/focus_palette.rs b/codex-rs/tui/tests/suite/focus_palette.rs
index 038237da36..8342b9548c 100644
--- a/codex-rs/tui/tests/suite/focus_palette.rs
+++ b/codex-rs/tui/tests/suite/focus_palette.rs
@@ -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(())
}