microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.88k stars 8.22k forks source link

The URL highlighting fade effect may look unpleasant with TUI programs #17728

Open Zeroes1 opened 4 weeks ago

Zeroes1 commented 4 weeks ago

Windows Terminal version

1.21.1772.0

Windows build number

10.0.19045.3448

Other Software

Far Manager 3.0.6359.0 x64

Steps to reproduce

Run FAR Manager create new file, insert line: https://aka.ms/terminal-documentation save

set mouse cursor over URL press Esc (exit from editor to panel)

Expected Behavior

no strange visual effects

Actual Behavior

Effect of fade highlight URLs may be strange look (as flickering line) with TUI programs for example FAR Manager (in example Video when exit from editor).

https://github.com/user-attachments/assets/1a474490-e660-4ab5-a554-72792c67b0d7

lhecker commented 4 weeks ago

We did this to improve the performance of the application. Scanning for URLs all the time is somewhat expensive after all. To fix this we could hide all URL underlines whenever there's output and only show them when there hasn't been any new output for a while. I think that may be look a lot better, but it's possible that this may result in similar edge cases.

zadjii-msft commented 3 weeks ago

Another possible heuristic we could try: hide them if there's ever a frame that invalidates the whole buffer? Clearly Far isn't using alt buffers here, so we can't use that as the heuristic. But a full-frame invalidation seems like it would suggest the whole thing changed like the way a full-viewport app would.

There's also the xterm.js suggestion where we just don't do the URL scanning at all anymore. They just scan the row the mouse pointer is on, and check if that text is a URL. Not sure we're tracking that anywhere