{"record":{"id":"6cb246d4e01180a3","repo":"wezterm/wezterm","slug":"missing-history-limit","errorCode":null,"errorMessage":"missing history_limit","messagePattern":"missing history_limit","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"mux/src/tmux_commands.rs","lineNumber":825,"sourceCode":"                .next()\n                .ok_or_else(|| anyhow!(\"missing window_height\"))?\n                .parse()?;\n            let window_active = fields\n                .next()\n                .ok_or_else(|| anyhow!(\"missing window_active\"))?\n                .parse::<usize>()?;\n\n            let window_name = fields\n                .next()\n                .ok_or_else(|| anyhow!(\"missing window_name\"))?;\n\n            let window_layout = fields\n                .next()\n                .ok_or_else(|| anyhow!(\"missing window_layout\"))?;\n\n            let history_limit = fields\n                .next()\n                .ok_or_else(|| anyhow!(\"missing history_limit\"))?\n                .parse::<isize>()?;\n\n            let window_active = window_active == 1;\n\n            if let Some(x) = self.window_id {\n                if x != window_id {\n                    continue;\n                }\n            }\n\n            let layout_csum = window_layout\n                .get(0..4)\n                .ok_or_else(|| anyhow!(\"missing window_layout\"))?;\n            let window_layout = window_layout\n                .get(5..)\n                .ok_or_else(|| anyhow!(\"missing window_layout\"))?;\n\n            let layout = parse_layout(window_layout)?;","sourceCodeStart":807,"sourceCodeEnd":843,"githubUrl":"https://github.com/wezterm/wezterm/blob/08e5e0afc6007567d3d131bc2ec1382423c0d2da/mux/src/tmux_commands.rs#L807-L843","documentation":"Final field of WezTerm's tmux window parser: `history_limit` is read with `fields.next()` and parsed as isize. `missing history_limit` means the reply line ended after exactly 7 of 8 tokens — everything through window_layout was present but the per-window scrollback limit never arrived.","triggerScenarios":"A window sync where the captured line stops at 7 tokens. Because this is the trailing field, likely causes are the server truncating the last variable, or a tmux version whose rendering of the fixed `#{...} #{history_limit}` format ends early; stray non-listing lines also land here.","commonSituations":"`history_limit` as a window format variable exists in modern tmux; very old or patched servers are the usual suspects, plus partial writes under load. The error fails the whole sync round.","solutions":["Run `tmux -V` and upgrade to mainstream tmux >= 3.1 (history_limit support in formats is longstanding but old forks vary).","Replay the exact list-windows format under `tmux -CC` and confirm the 8th token appears for every window.","Test with `tmux -f /dev/null`.","Update WezTerm.","Capture the malformed line with WEZTERM_LOG=trace and report upstream."],"exampleFix":"// before\nlet history_limit = fields\n    .next()\n    .ok_or_else(|| anyhow!(\"missing history_limit\"))?\n    .parse::<isize>()?;\n\n// after\nlet fields: Vec<&str> = line.split(' ').collect();\nanyhow::ensure!(fields.len() >= 8, \"malformed list-windows line: {line:?}\");\nlet history_limit: isize = fields[7].parse()?;","handlingStrategy":"validation","validationCode":"// history_limit is the 8th and final field\nfn window_line_is_complete(line: &str) -> bool {\n    !line.is_empty() && line.split(' ').count() >= 8\n}","typeGuard":null,"tryCatchPattern":"match sync_windows().await {\n    Err(e) if e.to_string().contains(\"missing history_limit\") => {\n        // trailing field missing: likely incompatible/truncated server output\n        log::warn!(\"tmux omitted history_limit: {e:#}\");\n    }\n    other => other?,\n}","preventionTips":["Confirm `#{history_limit}` renders in your tmux build via `tmux display-message -p '#{history_limit}'`","Upgrade old servers before attaching the WezTerm tmux domain","Include tmux version info in any bug report about this error"],"tags":["tmux","wezterm","parsing","rust","control-mode","scrollback"],"backgroundTag":"malformed-response-parse-error","analyzedSha":"08e5e0afc6007567d3d131bc2ec1382423c0d2da","analyzedAt":"2026-08-20T04:47:31.434Z","contentChangedAt":"2026-08-20T04:47:31.434Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}