hoverCursorFor function

MouseCursor hoverCursorFor({
  1. required bool hyperlink,
  2. required int modeFlags,
  3. required MouseCursor base,
})

The mouse pointer shape over a terminal cell, mirroring alacritty's reset_mouse_cursor (MouseCursorDirty handling): a link shows the click pointer; when the app captures the mouse (MOUSE_MODE) the pointer reverts to the platform arrow; otherwise the configured base (an I-beam) is used. Pure so it's unit-testable without driving pointer events.

Implementation

MouseCursor hoverCursorFor({
  required bool hyperlink,
  required int modeFlags,
  required MouseCursor base,
}) {
  if (hyperlink) return SystemMouseCursors.click;
  if (anyMouse(modeFlags)) return SystemMouseCursors.basic;
  return base;
}