Commit fd8c52b
committed
Stop mouse wheel from leaking escape characters into form fields
Scrolling the mouse wheel while a title or description field was focused
could insert stray characters (fragments of SGR mouse escape sequences)
into the field. The submit TUI ran the Bubble Tea program with
WithMouseAllMotion (mode 1003), which reports an event on every pointer
move. During a wheel scroll that floods the input stream, and under that
volume Bubble Tea can split a mouse escape sequence across input reads;
the leftover bytes of a partially-parsed sequence are then emitted as
key runes and inserted into the focused text input.
Switch to WithMouseCellMotion (mode 1002), which reports clicks, drag,
and wheel but not idle pointer motion. That removes the input flood, so
wheel sequences arrive intact and are parsed as mouse messages (consumed
by handleMouse) instead of leaking as text. The TUI never used idle-hover
state for rendering, so cell-motion loses nothing.
Add a regression test asserting that wheel events over either panel never
modify the focused title or description field.1 parent a24bf4f commit fd8c52b
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
608 | 649 | | |
609 | 650 | | |
610 | 651 | | |
| |||
0 commit comments