From 4689ff369b9a015e7b0ea4fd44c37033582a29a4 Mon Sep 17 00:00:00 2001 From: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:02:26 +0800 Subject: [PATCH 1/2] test(tui): six terminal tests no longer follow the developer's terminal These tests read the terminal environment the suite runs in, and fail in common setups that CI never has: - inside tmux or GNU screen, or in Tilix or Terminator (TMUX, STY, TILIX_ID or TERMINATOR_UUID set), apply_env_overrides caps the redraw rate. The two Ghostty tests in settings and config_fancy_animations_keeps_ghostty_full_motion assert it is not capped, so they fail there. They already remove the SSH markers for the same reason; the sibling tests no_animations_* and other_terminals_* already remove these four as well. - over SSH (SSH_CLIENT, SSH_CONNECTION or SSH_TTY set) the clipboard export goes to the terminal client and says so, and command_clipboard_export_preserves_structure_and_redacts_secrets expects "local clipboard". - with NO_ANIMATIONS=1 exported, the two Ghostty tests, non_vscode_term_program_does_not_force_low_motion and tilix_and_terminator_cap_redraws_without_disabling_motion fail because motion is switched off before they look at it. Each test now removes those variables for its own duration with EnvVarGuard, under the env lock it already holds. Production code is unchanged. Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com> --- crates/tui/src/commands/groups/config/config.rs | 4 ++++ .../src/commands/session_export_regression_tests.rs | 3 +++ crates/tui/src/settings.rs | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/crates/tui/src/commands/groups/config/config.rs b/crates/tui/src/commands/groups/config/config.rs index 8cdabaee35..9b7d4731a4 100644 --- a/crates/tui/src/commands/groups/config/config.rs +++ b/crates/tui/src/commands/groups/config/config.rs @@ -4586,6 +4586,10 @@ mod tests { )); fs::create_dir_all(&temp_root).unwrap(); let _guard = EnvGuard::new(&temp_root); + let _tmux = EnvVarGuard::remove("TMUX"); + let _sty = EnvVarGuard::remove("STY"); + let _tilix_id = EnvVarGuard::remove("TILIX_ID"); + let _terminator_uuid = EnvVarGuard::remove("TERMINATOR_UUID"); // Neutralize the SSH markers: production intentionally caps motion // over SSH, and the suite routinely runs inside one. let _ssh_client = EnvVarGuard::remove("SSH_CLIENT"); diff --git a/crates/tui/src/commands/session_export_regression_tests.rs b/crates/tui/src/commands/session_export_regression_tests.rs index 77ae69b92e..ca4b4f668c 100644 --- a/crates/tui/src/commands/session_export_regression_tests.rs +++ b/crates/tui/src/commands/session_export_regression_tests.rs @@ -42,6 +42,7 @@ struct ExportHarness { // temporary files are removed (matches ControlHarness). _home: EnvVarGuard, _codewhale_home: EnvVarGuard, + _ssh: [EnvVarGuard; 3], _env_lock: TestEnvLock, temp: TempDir, } @@ -54,6 +55,7 @@ impl ExportHarness { std::fs::create_dir_all(&home).expect("home dir"); let _home = EnvVarGuard::set("HOME", &home); let _codewhale_home = EnvVarGuard::set("CODEWHALE_HOME", &home); + let _ssh = ["SSH_CLIENT", "SSH_CONNECTION", "SSH_TTY"].map(EnvVarGuard::remove); let options = TuiOptions { skills_dir: temp.path().join("skills"), memory_path: temp.path().join("memory.md"), @@ -66,6 +68,7 @@ impl ExportHarness { app, _home, _codewhale_home, + _ssh, _env_lock: env_lock, temp, } diff --git a/crates/tui/src/settings.rs b/crates/tui/src/settings.rs index 05849bdd76..6eccd0b481 100644 --- a/crates/tui/src/settings.rs +++ b/crates/tui/src/settings.rs @@ -4358,6 +4358,11 @@ zai = ["GLM-5.2", "GLM-5.3"] #[test] fn ghostty_term_program_keeps_full_motion_without_the_legacy_30_fps_cap() { let _g = term_program_test_guard(); + let _tmux = crate::test_support::EnvVarGuard::remove("TMUX"); + let _sty = crate::test_support::EnvVarGuard::remove("STY"); + let _tilix_id = crate::test_support::EnvVarGuard::remove("TILIX_ID"); + let _terminator_uuid = crate::test_support::EnvVarGuard::remove("TERMINATOR_UUID"); + let _no_animations = crate::test_support::EnvVarGuard::remove("NO_ANIMATIONS"); // Neutralize the SSH markers: production intentionally caps motion // over SSH, and the suite routinely runs inside one. let _ssh_client = crate::test_support::EnvVarGuard::remove("SSH_CLIENT"); @@ -4386,6 +4391,11 @@ zai = ["GLM-5.2", "GLM-5.3"] #[test] fn ghostty_term_fallback_keeps_full_motion_without_the_legacy_30_fps_cap() { let _g = term_program_test_guard(); + let _tmux = crate::test_support::EnvVarGuard::remove("TMUX"); + let _sty = crate::test_support::EnvVarGuard::remove("STY"); + let _tilix_id = crate::test_support::EnvVarGuard::remove("TILIX_ID"); + let _terminator_uuid = crate::test_support::EnvVarGuard::remove("TERMINATOR_UUID"); + let _no_animations = crate::test_support::EnvVarGuard::remove("NO_ANIMATIONS"); // Neutralize the SSH markers: production intentionally caps motion // over SSH, and the suite routinely runs inside one. let _ssh_client = crate::test_support::EnvVarGuard::remove("SSH_CLIENT"); @@ -4419,6 +4429,7 @@ zai = ["GLM-5.2", "GLM-5.3"] #[test] fn non_vscode_term_program_does_not_force_low_motion() { let _g = term_program_test_guard(); + let _no_animations = crate::test_support::EnvVarGuard::remove("NO_ANIMATIONS"); let prev = std::env::var_os("TERM_PROGRAM"); let prev_term = std::env::var_os("TERM"); let prev_ssh_client = std::env::var_os("SSH_CLIENT"); @@ -4486,6 +4497,7 @@ zai = ["GLM-5.2", "GLM-5.3"] #[test] fn tilix_and_terminator_cap_redraws_without_disabling_motion() { let _g = term_program_test_guard(); + let _no_animations = crate::test_support::EnvVarGuard::remove("NO_ANIMATIONS"); // Neutralize the SSH markers: production intentionally caps motion // over SSH, and the suite routinely runs inside one. let _ssh_client = crate::test_support::EnvVarGuard::remove("SSH_CLIENT"); From 341b0623fbdf4b5060fcd0daaa0300451dac918c Mon Sep 17 00:00:00 2001 From: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com> Date: Thu, 15 Oct 2026 14:02:33 +0800 Subject: [PATCH 2/2] test(tui): carry the multiplexer guards to the moved Ghostty config test config_fancy_animations_keeps_ghostty_full_motion now lives in config_main_host.rs. Like before the move, it removes TMUX, STY, TILIX_ID and TERMINATOR_UUID for its duration so it doesn't fail inside tmux, GNU screen, Tilix or Terminator. Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com> --- crates/tui/src/commands/config_main_host.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/tui/src/commands/config_main_host.rs b/crates/tui/src/commands/config_main_host.rs index 22474e4701..bedc810dbc 100644 --- a/crates/tui/src/commands/config_main_host.rs +++ b/crates/tui/src/commands/config_main_host.rs @@ -4122,6 +4122,10 @@ mod tests { )); fs::create_dir_all(&temp_root).unwrap(); let _guard = EnvGuard::new(&temp_root); + let _tmux = EnvVarGuard::remove("TMUX"); + let _sty = EnvVarGuard::remove("STY"); + let _tilix_id = EnvVarGuard::remove("TILIX_ID"); + let _terminator_uuid = EnvVarGuard::remove("TERMINATOR_UUID"); // Neutralize the SSH markers: production intentionally caps motion // over SSH, and the suite routinely runs inside one. let _ssh_client = EnvVarGuard::remove("SSH_CLIENT");