Commit 7d30ac7
Revert #5276 over-eager OSC 8 close; fix _rowsWithUrls stale tracking
The condition added in 56eef0c ("emit OSC 8 close at row start whenever
the row had URLs previously") was a defensive workaround for the apparent
floating-underline symptom on Warp/Windows Terminal. Investigation of WT
source shows the bug is in ControlCore::_updateHoveredCell()'s stale
_lastHoveredCell cache (no callback fires when buffer content changes
under a stationary cursor) — not in Terminal.Gui's emission. The cells
themselves get _hyperlinkId = 0 correctly via AdaptDispatch::EndHyperlink
when we emit `OSC 8 ; ; ST` followed by new cell content.
Restoring the original (rowHadUrlsPreviously && \!rowHasUrlsNow) condition
avoids a redundant escape on every row that still contains a URL after
redraw. Also drops the regression test that pinned the redundant behavior.
Separately, fix a real bookkeeping bug: _rowsWithUrls.Add/Remove was
placed after the empty-builder early-exit at the end of the per-row block.
Rows whose dirty cells were entirely flushed mid-loop via WriteToConsole
(leaving the builder empty and _lastUrl null) skipped the row-tracking
update, leaving stale entries that trigger spurious row-start OSC 8 closes
on subsequent frames. Move the Add/Remove before the early-exit, and add
a regression test that fails without the fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 56eef0c commit 7d30ac7
2 files changed
Lines changed: 62 additions & 39 deletions
File tree
- Terminal.Gui/Drivers/Output
- Tests/UnitTestsParallelizable/Drivers/Output
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
202 | 217 | | |
203 | 218 | | |
204 | 219 | | |
| |||
227 | 242 | | |
228 | 243 | | |
229 | 244 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | 245 | | |
240 | 246 | | |
241 | 247 | | |
| |||
Lines changed: 46 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | 428 | | |
458 | 429 | | |
459 | 430 | | |
| |||
552 | 523 | | |
553 | 524 | | |
554 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
555 | 572 | | |
556 | 573 | | |
557 | 574 | | |
| |||
0 commit comments