Repository: vscode
Issue: Terminal animations break link detection in integrated terminal
Labels: bug,terminal-links

## Description

When parts of the terminal are updated, link detection breaks momentarily. For projects with an in-terminal spinner, for example, this breaks all link detection for areas of the terminal near the spinners.

Reproduction Video:
https://github.com/microsoft/vscode/assets/1174858/12b53246-9922-4d67-88d6-f15188a24a1a

In the video I'm using [powertoys](https://github.com/microsoft/PowerToys/releases/tag/v0.80.1) to highlight mouse clicks.
Note that both xterm links and link text are only intermittently clickable on updated lines, or lines in-between updated lines

Apologies for not submitting through the integrated help menu, it wasn't able to submit.

## Reproduction Steps
Run the following bash snippet in an integrated bash terminal.

```sh
for i in 1 2 3 4 5; do printf '      \e]8;;http://example.com\e\\example link\e]8;;\e\\    http://example.com/\r\n'; done;x=1; while true; do echo -en '\033[1A'$x'\033[1A'$x'\033[2A'$x'\033[4B\033[20D'; sleep 0.032; x=$(((x+1) %10)); done
```

This snippet:
1. Starts by printing 5 base lines, each of which has an xterm-format link and raw text of an http link.
2. repeatedly prints the characters 1..9 on the 5th, 4th, and 2nd line of the previous printout by moving the cursor up and printing.

This breaks link detection on the text on lines 2-5. Ctrl+Clicking those links will _sometimes_ work, but most often will fail.
I believe this is because the link detection is run asynchronously, and is racing with the frame-rate of the animation. If you increase the interval of the sleep in the loop, the link detection _mostly_ works again, unless you happen to click right after an animation frame

Curiously, links are broken on line _3_, despite no text being printed on that line in the loop. So apart from not updating the text, there's not a clean way to

I've tested this against Windows Terminal (1.19.10821.0) and it does not have the same issues.

### System Information
CPUs | 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
-- | --
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled
Load (avg) |  
Memory (System) | 15.85GB (1.34GB free)
Process Argv | --crash-reporter-id 3c1cf59f-7aee-4956-9491-0667a0ce233d
Screen Reader | no
VM | 0%

### Extensions
Extensions: none

### A/B Experiment Info
```
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r3:30993541
dsvsc020:30976470
pythonait:31006305
gee8j676:31009558
dsvsc021:30996838
01bff139:31013167
pythoncenvpt:31022790
```