{"record":{"id":"89828c75376ba82d","repo":"Hmbown/CodeWhale","slug":"invalid-tui-alternate-screen-mode-expected-au","errorCode":null,"errorMessage":"Invalid tui.alternate_screen '{mode}': expected auto, always, or never.","messagePattern":"Invalid tui\\.alternate_screen '(.+?)': expected auto, always, or never\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":5193,"sourceCode":"            }\n        }\n        if let Some(mode) = self.sandbox_mode.as_deref() {\n            let normalized = mode.trim().to_ascii_lowercase();\n            if !matches!(\n                normalized.as_str(),\n                \"read-only\" | \"workspace-write\" | \"danger-full-access\" | \"external-sandbox\"\n            ) {\n                anyhow::bail!(\n                    \"Invalid sandbox_mode '{mode}': expected read-only, workspace-write, danger-full-access, or external-sandbox.\"\n                );\n            }\n        }\n        if let Some(tui) = &self.tui\n            && let Some(mode) = tui.alternate_screen.as_deref()\n        {\n            let mode = mode.to_ascii_lowercase();\n            if !matches!(mode.as_str(), \"auto\" | \"always\" | \"never\") {\n                anyhow::bail!(\n                    \"Invalid tui.alternate_screen '{mode}': expected auto, always, or never.\"\n                );\n            }\n        }\n        if let Some(transcript) = &self.transcript\n            && let Err(detail) = transcript.prose_measure_columns()\n        {\n            anyhow::bail!(\"Invalid transcript.prose_measure: {detail}.\");\n        }\n        if let Some(auto_review) = &self.auto_review {\n            auto_review.validate()?;\n        }\n        if let Some(providers) = &self.providers {\n            providers.validate()?;\n        }\n        Ok(())\n    }\n","sourceCodeStart":5175,"sourceCodeEnd":5211,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L5175-L5211","documentation":"The `tui.alternate_screen` config option controls whether the TUI uses the terminal's alternate screen buffer. It accepts exactly `auto`, `always`, or `never`; any other value fails config validation.","triggerScenarios":"`Config::validate` runs with `self.tui` set and `tui.alternate_screen` lowercased is not one of `auto` | `always` | `never`.","commonSituations":"Typing boolean-like values (`true`, `false`, `yes`, `on`) into a tri-state option; typos such as `alway`; copying values from a tool that uses booleans for this setting.","solutions":["Set `tui.alternate_screen = \"auto\"` (recommended default).","Use `\"always\"` or `\"never\"` for explicit control.","Remove the key so the TUI default applies."],"exampleFix":"// before (config.toml)\n[tui]\nalternate_screen = \"true\"\n\n// after\n[tui]\nalternate_screen = \"auto\"","handlingStrategy":"validation","validationCode":"assert!(matches!(mode.to_ascii_lowercase().as_str(), \"auto\" | \"always\" | \"never\"), \"bad tui.alternate_screen: {mode}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["This is a tri-state string, not a boolean — never write true/false/yes/on.","Leave it unset for `auto` behavior."],"tags":["config","validation","tui"],"backgroundTag":"invalid-enum-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}