szn

Bug 210 — Host terminal auto-wrap (DECAWM) causes screen scrolling on bottom-right cell writes — scattered text and color remnants

210. Host terminal auto-wrap (DECAWM) causes screen scrolling on bottom-right cell writes — scattered text and color remnants

File: src/server/render.zig:103–116, src/input.zig:837 Severity: HIGH Status: ✅ FIXED — disabled auto-wrap (\x1b[?7l) on alternative screen entry and re-enabled it (\x1b[?7h) on exit. Also added support for private mode 7 (DECAWM) DECSET/DECRST parsing in InputParser. Added unit test.

When characters (or spaces) are written to the bottom-right corner (last column of the last line) on a terminal with auto-wrap (DECAWM) enabled, the terminal automatically wraps/scrolls up the entire screen by one line. Because the renderer’s diff tracking (last_cells) is unaware of this scroll, it gets out of sync with the host terminal. Subsequent updates only rewrite what the renderer believes are changed cells relative to the pre-scrolled state, resulting in scattered text and color bleeding/remnants on screen (most visible during heavy and scrolling PTY output like ninja builds). Disabling auto-wrap on the host terminal prevents unexpected scrolling.