Commit 46cc903
committed
Pause cursor blinking when the terminal loses focus
The cursor now blinks only while the terminal has focus when focus
tracking is enabled. This applies to both native caret views and the
Metal renderer on macOS and iOS. Steady cursor styles remain unchanged.
Focus changes, key-window changes, and changes to focus tracking now
refresh the cursor animation and Metal display. This keeps the cursor
visible and updates its appearance without waiting for a later redraw.
The unfocused Metal cursor uses a narrower outline. This matches the
visible inner half of the centered Core Graphics stroke after clipping.
When debugging cursor state, check terminal focus, focus tracking, and
whether the native or Metal renderer is active. A cursor that stops
blinking while unfocused is expected behavior.1 parent 6899ad3 commit 46cc903
5 files changed
Lines changed: 58 additions & 24 deletions
File tree
- Sources/SwiftTerm
- Apple/Metal
- Mac
- iOS
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| |||
2285 | 2287 | | |
2286 | 2288 | | |
2287 | 2289 | | |
2288 | | - | |
| 2290 | + | |
| 2291 | + | |
2289 | 2292 | | |
2290 | 2293 | | |
2291 | 2294 | | |
| |||
2304 | 2307 | | |
2305 | 2308 | | |
2306 | 2309 | | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
2312 | 2310 | | |
2313 | 2311 | | |
2314 | 2312 | | |
2315 | 2313 | | |
2316 | 2314 | | |
2317 | 2315 | | |
2318 | 2316 | | |
2319 | | - | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
2320 | 2320 | | |
2321 | 2321 | | |
2322 | 2322 | | |
| |||
2873 | 2873 | | |
2874 | 2874 | | |
2875 | 2875 | | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
2876 | 2887 | | |
2877 | 2888 | | |
2878 | 2889 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | | - | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
117 | | - | |
| 122 | + | |
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
| |||
601 | 604 | | |
602 | 605 | | |
603 | 606 | | |
604 | | - | |
| 607 | + | |
605 | 608 | | |
606 | 609 | | |
607 | 610 | | |
608 | | - | |
609 | | - | |
| 611 | + | |
| 612 | + | |
610 | 613 | | |
611 | | - | |
612 | | - | |
| 614 | + | |
| 615 | + | |
613 | 616 | | |
614 | 617 | | |
615 | 618 | | |
616 | 619 | | |
617 | 620 | | |
618 | | - | |
| 621 | + | |
619 | 622 | | |
620 | 623 | | |
621 | 624 | | |
622 | | - | |
623 | | - | |
624 | | - | |
| 625 | + | |
| 626 | + | |
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
| |||
1076 | 1078 | | |
1077 | 1079 | | |
1078 | 1080 | | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1079 | 1084 | | |
1080 | 1085 | | |
1081 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | | - | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
2584 | 2587 | | |
2585 | 2588 | | |
2586 | 2589 | | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
2587 | 2593 | | |
2588 | 2594 | | |
2589 | 2595 | | |
| |||
2593 | 2599 | | |
2594 | 2600 | | |
2595 | 2601 | | |
2596 | | - | |
2597 | | - | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
2598 | 2606 | | |
2599 | 2607 | | |
2600 | 2608 | | |
| |||
0 commit comments