Commit ac99a54
authored
Mouse motion row and focus reporting fixes (#590)
* Report current focus state immediately when DECSET 1004 is enabled
xterm reports the current focus state as soon as an application enables
focus reporting; without it, applications that enable 1004 while the
terminal is already focused assume they are unfocused until the first
real focus change (e.g. Claude Code's Enter handling stays inert until
the user clicks away and back).
Terminal now tracks the host view's focus (setTerminalFocus updates it
regardless of reporting mode) and DECSET 1004 replies with CSI I / CSI O
for the tracked state right away.
* Mac: report viewport rows in mouse motion events, drop stray print
sendMotion was passed the buffer-absolute row (hit.grid.row includes
yDisp) while press/release/drag paths already convert to screen rows;
once any scrollback exists, hover-tracking applications receive rows
far outside the viewport and their hit-testing never matches.
Also removes a leftover debug print in the SGR-pixel mouse encoder
that fires on every event.1 parent ed395c7 commit ac99a54
3 files changed
Lines changed: 85 additions & 4 deletions
File tree
- Sources/SwiftTerm
- Mac
- Tests/SwiftTermTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2682 | 2682 | | |
2683 | 2683 | | |
2684 | 2684 | | |
2685 | | - | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
2686 | 2693 | | |
2687 | 2694 | | |
2688 | 2695 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
572 | 577 | | |
573 | 578 | | |
| 579 | + | |
574 | 580 | | |
575 | | - | |
576 | | - | |
| 581 | + | |
577 | 582 | | |
578 | 583 | | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
579 | 589 | | |
580 | 590 | | |
581 | 591 | | |
| |||
4406 | 4416 | | |
4407 | 4417 | | |
4408 | 4418 | | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
4409 | 4423 | | |
4410 | 4424 | | |
4411 | 4425 | | |
| |||
5735 | 5749 | | |
5736 | 5750 | | |
5737 | 5751 | | |
5738 | | - | |
5739 | 5752 | | |
5740 | 5753 | | |
5741 | 5754 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments