xtermjs/xterm.js
Voir sur GitHubActively detect links under the cursor when lines change
Open
#4 323 ouverte le 16 déc. 2022
area/linkshelp wantedtype/enhancement
Métriques du dépôt
- Stars
- (16 196 stars)
- Métriques de merge PR
- (Merge moyen 4j 3h) (81 PRs mergées en 30 j)
Description
The PR https://github.com/xtermjs/xterm.js/pull/4298 made it so that an active link under the cursor would be re-evaluated instead of thrown away when the line changes, but we also want to capture this case:

Repro:
- Fill viewport
- Run
echo -n "http://example.com/" && sleep 1 && echo -n "a" && sleep 1 && echo -n "b" && sleep 1 && echo -n "c" && sleep 1 && echo -n " x" && sleep 1 && echo -n "x" && sleep 1 && echo "x" && sleep 1 && echo "y" && sleep 1 && echo "y" && sleep 1 && echo "y" - Put cursor above
http://example.com/, when a line is added such that the cursor is over the link, the link should get an underline and clicking should activate it, without needing to move the cursor beforehand
This change makes this happen but will result in a lot of work:
this._renderService.onRenderedViewportChange(e => {
if (this._lastMouseEvent) {
this._handleMouseMove(this._lastMouseEvent);
}
});
Can augment the above, the solution in #4298, some debouncing and possible some other form of caching to save some CPU cycles?