Skip to content

Commit b8e5747

Browse files
committed
fix(web): refresh link hover after mouse release
1 parent f2e6b6e commit b8e5747

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎apps/web/src/terminal/ghostty/surface.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,8 @@ export class GhosttyTerminalSurface {
11121112
event.preventDefault();
11131113
this.hoverPointer = { x: event.clientX, y: event.clientY };
11141114
this.linkModifierActive = isTerminalLinkPointerGesture(event);
1115+
// A drag whose press was already sent to the terminal application cannot
1116+
// turn into link activation midway through, so link feedback would lie.
11151117
this.setHoveredLink(null);
11161118
this.canvas.style.cursor = "default";
11171119
this.sendMouse("motion", this.buttonFromButtons(event.buttons), event);
@@ -1252,6 +1254,13 @@ export class GhosttyTerminalSurface {
12521254
if (this.canvas.hasPointerCapture(event.pointerId)) {
12531255
this.canvas.releasePointerCapture(event.pointerId);
12541256
}
1257+
if (event.type === "pointercancel") {
1258+
this.clearHoveredLink();
1259+
} else {
1260+
this.hoverPointer = { x: event.clientX, y: event.clientY };
1261+
this.linkModifierActive = isTerminalLinkPointerGesture(event);
1262+
this.refreshHoveredLink();
1263+
}
12551264
return;
12561265
}
12571266
if (this.canvas.hasPointerCapture(event.pointerId)) {

0 commit comments

Comments
 (0)