The custom mobile text-selection layer positioned the start handle at
`x - HANDLE_SIZE_PX / 2`, so a selection beginning at column 0 placed it
at ~-11px. The overlay clips with overflow:hidden, leaving only a sliver
against the screen edge that was impossible to grab — making it hard to
adjust the selection start point on the left edge.
Clamp each handle's horizontal position to stay fully within the terminal
area. This is visual only; drag tracking uses the finger's coordinates,
so selection accuracy is unchanged. Also protects the end handle from
being clipped at the right edge.
xterm scrolls the viewport 1:1 with the finger and prevents native
scrolling, so the terminal stopped the instant the finger lifted with
no momentum — making it tedious to scroll long output on mobile.
Track finger velocity during a one-finger drag and, on release, keep
scrolling the viewport with friction until it slows to a stop or hits
the buffer bounds. Inertia is cancelled on a new touch, selection,
pinch, or dispose so it never fights the user. Coasting behaviour is
tunable via the SCROLL_INERTIA_* constants.