Repository navigation
Conversation
ConPTY drops a program's mouse DECSET, so the tap never learns the program asked for the mouse: `CSI ? 1000 h`, `1002 h` and `1006 h` written to its stdout never reach the reader, while `1049 h`, `2004 h`, `1001 h`, `1015 h` and `1030 h` do. The wheel therefore took the alternate-screen branch and sent arrows, which RPI's `--tui-mode fullscreen` answered by moving its draft instead of scrolling the transcript above it. ConPTY does translate an SGR mouse report written to its input pipe into a `MOUSE_EVENT` for the program, whether or not its own DECSET survived, so `wheel` sends an SGR report rather than arrows when the tap has never read a mouse mode and the pointer is over the alternate screen. The same fallback carries a press, its motion and its release, so RPI's jump-to-end control answers a click instead of starting a selection. `report` takes the format as an argument, since that path needs SGR where the program's own mode named another. `saw_mouse` lives on every platform, though only Windows reads it, so the fallback is one shape everywhere; `cfg!(windows)` keeps `hidden` false off Windows, where a mode the tap read always holds. Writing through `WriteConsoleW` with `ENABLE_VIRTUAL_TERMINAL_PROCESSING` leaves the DECSET dropped, so that is not the answer; Windows Terminal's `CreatePseudoConsole` flags match alacritty's. A limit: a program on the alternate screen that wants no mouse, vim with its own scroll off among them, now takes the wheel as a report.
Contributor
Author
|
咦,明明是我的提交,怎么在这里显示成雷电芽衣了?这AI又犯了什么病了啊?不过无所谓了 |
Contributor
绷不住了。我在合并的时候看看能不能修改一下。🤣🤣🤣 |
Contributor
|
Thank you, zcg. Merged in parts on main:
The fallback itself is not merged. |
Raiden-MeixElysia
pushed a commit
that referenced
this pull request
Oct 28, 2026
zcg found it typing by voice on Windows, in PR #34: gpui's shape_line asserts its text holds no newline, and a composition that held one reached it in paint_preedit, so the app died mid-composition. The composition draws on one line now, each control as its picture, as session labels do.
Raiden-MeixElysia
added a commit
that referenced
this pull request
Oct 28, 2026
PR #34 found the wheel dead over full-screen programs on Windows: the system's conhost drops a program's CSI ? 1000 h, 1002 h and 1006 h, so the tap never heard the mouse. Microsoft's OpenConsole, which Windows Terminal runs on, passes them through: a probe on build 26300 read ?1000h ?1002h ?1006h from OpenConsole 1.25 and none from conhost. vendor/conpty holds conpty.dll and OpenConsole.exe from NuGet's Microsoft.Windows.Console.ConPTY 1.25.260930003, signed by Microsoft, MIT. build.rs copies them beside every Windows build; alacritty loads the conpty.dll beside the executable. Each spawn names the ConPTY it runs on and fails unless it is the bundled one with OpenConsole beside it. The zip carries both and their license. PR #34's guess, mouse reports on the alternate screen when no mode was heard, is dropped: vim and less would have taken reports for arrows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On Windows, a wheel over a full-screen program scrolled nothing: in RPI's
--tui-mode fullscreenthe wheel moved the draft instead of the transcript above it, and a click on RPI's jump-to-end control started a selection instead of answering it.Why
ConPTY drops a program's mouse DECSET. A program that writes
CSI ? 1000 h,1002 hor1006 hto its stdout never has that byte reach the reader, so the tap'sModesnever learns the program asked for the mouse and the view'smousestaysOff. I measured which sequences survive:1049 h,2004 h,1001 h,1015 hand1030 hdo; the standard mouse-tracking modes do not.The wheel therefore took the alternate-screen branch and sent arrows, which RPI's editor answered.
ConPTY does translate an SGR mouse report written to its input pipe into a
MOUSE_EVENTfor the program, and it does so whether or not its own DECSET survived. So the fix sends an SGR report rather than arrows when the tap has never read a mouse mode and the pointer is over the alternate screen.How
TerminalView::wheelsends an SGR report instead of arrows under that condition; the same fallback carries a press, its motion and its release, so RPI's jump-to-end control answers a click instead of starting a selection.saw_mouserecords whether the tap has ever read a mouse mode; a full reset clears it. It lives on every platform, though only Windows reads it, so the fallback has one shape everywhere andcfg!(windows)keeps it inert off Windows.reporttakes the format as an argument, since that path needs SGR where the program's own mode named another.Verified
--tui-mode fullscreen: the wheel now scrolls the transcript above the draft, and the jump-to-end control answers a click.cargo clippy --all-targets -- -D warningsclean,cargo fmt --checkclean, 280 tests pass.hiddenis always false, soaskedreturns the mode the tap read unchanged. I checked the non-Windows path compiles by forcing the predicate false. Linux and macOS behaviour is untouched; CI covers all three.Not the answer
WriteConsoleWwithENABLE_VIRTUAL_TERMINAL_PROCESSINGleaves the DECSET dropped.CreatePseudoConsole's flags: Windows Terminal's match alacritty's, so they are not the difference.Limit
A program on the alternate screen that wants no mouse — vim with its own scroll off among them — now takes the wheel as a report. There is no reliable signal that tells "the program wants the mouse but ConPTY ate the DECSET" from "the program wants no mouse"; alt-screen is the closest one available.