mirror of
https://github.com/zellij-org/zellij.git
synced 2026-10-11 22:50:07 +00:00
Windows Terminal does not set TERM by default, so zellij on WT was using the native-console crossterm path that reads INPUT_RECORDs. That path can't observe bracketed-paste sequences (`\e[200~/\e[201~`), which is one of the reasons multi-line paste has never worked correctly on Windows (issue #4885). WT sets `WT_SESSION` per-process. Use that as a second trigger for the VT input path so default WT installs get raw VT byte input (and with it, termwiz's bracketed-paste detection, the SGR mouse format, correct emoji delivery, etc.) without requiring the user to set TERM. Introduce `use_vt_path()` in `os_input_output_windows.rs` as the single source of truth for the gate. Previously the stdin handler had one TERM check and `enable_mouse_support` / `disable_mouse_support` each had their own — so adding `WT_SESSION` to just the stdin gate caused mouse setup to take the native-console branch, which calls `crossterm::event::EnableMouseCapture` and clobbers the `ENABLE_VIRTUAL_TERMINAL_INPUT` flag the stdin path had just set. That broke all input from WT until the helper aligned every site.