mirror of
https://github.com/neovim/neovim.git
synced 2026-03-28 11:22:03 +00:00
Problem: Applications running inside :terminal that use DEC private mode 2026 (synchronized output) to batch screen updates get garbled rendering. Neovim's embedded libvterm does not handle mode 2026, so the synchronization sequences are ignored and intermediate screen states leak through as visual corruption. Solution: Add mode 2026 support to libvterm's state machine and wire it through to terminal.c. When an application enables mode 2026, invalidation of the terminal buffer is deferred until the application disables it, causing all accumulated screen updates to flush as a single atomic refresh. * fix(terminal): harden sync output redraw gating Problem: The initial mode 2026 implementation gated invalidate_terminal() but missed three other redraw paths: term_sb_push/term_sb_pop bypassed the gate by directly adding to invalidated_terminals, refresh_timer_cb could fire mid-sync flushing partial state, and the 10ms timer delay after sync-end left a window for stale repaints. Solution: - Gate term_sb_push/term_sb_pop during synchronized output - Skip syncing terminals in refresh_timer_cb - On sync end, schedule a zero-delay full-screen refresh via sync_flush_pending flag in terminal_receive() - Add news.txt entry for mode 2026 support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(terminal): add vterm unit tests for mode 2026 Add unit-level tests for synchronized output (mode 2026) to vterm_spec.lua, covering settermprop callbacks and DECRQM query/response. Suggested-by: justinmk Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(terminal): address review feedback for mode 2026 - Use multiqueue_put(main_loop.events) instead of restarting the global refresh timer on sync end, to avoid affecting other invalidated terminals. - Add screen:expect_unchanged() to verify screen doesn't update during sync mode. - Merge buffer-lines test into existing test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>