terminal icon indicating copy to clipboard operation
terminal copied to clipboard

The URL highlighting fade effect may look unpleasant with TUI programs

Open Zeroes1 opened this issue 1 year ago • 2 comments

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

Zeroes1 avatar Aug 16 '24 15:08 Zeroes1

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.

lhecker avatar Aug 16 '24 18:08 lhecker

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

zadjii-msft avatar Aug 19 '24 14:08 zadjii-msft