Skip to content

Fix the three input gaps of coder/ghostty-web#145 - #1

Merged
neomantra merged 1 commit into
nm-kitty-meowfrom
nm-145
Oct 19, 2026
Merged

neomantra merged 1 commit into
nm-kitty-meowfrom
nm-145

Conversation

@neomantra

Copy link
Copy Markdown

Fixes the three input-handling gaps reported in coder#145, each with tests.

  • Wheel with mouse tracking is reported as SGR mouse buttons 64/65. Terminal.handleWheel stopped every wheel event in the capture phase and sent arrow keys on the alternate screen, so InputHandler's SGR path never ran. It now leaves the event to InputHandler when the application has tracking on; arrows stay the fallback without it.
  • Ctrl+V and Cmd+V are forwarded as 0x16 before the browser's paste event, for programs that read the clipboard themselves (image paste). Text paste is unchanged. The two tests that asserted the old behaviour were updated.
  • DECSCUSR cursor shape changes are applied on the render tick. The configured cursorStyle stays until the application asks, so a configured bar or underline is not overridden by the WASM default on the first frame.

Checked with bun run fmt && bun run lint && bun run typecheck && bun test && bun run build:lib (532 tests). Verified in a browser against a Bubble Tea program with mouse reporting on: the wheel now scrolls the program's content.

Each change is self-contained and PR-able upstream to coder/ghostty-web.

- Wheel events go to the application as SGR mouse buttons 64/65 when it
  has mouse tracking on. Terminal.handleWheel used to prevent and stop every
  wheel event in the capture phase and send arrow keys on the alternate
  screen, so InputHandler's SGR path never ran. It now leaves the event to
  InputHandler when tracking is on; arrows stay the fallback without it.
- Ctrl+V and Cmd+V are forwarded as 0x16 before the browser's paste event,
  for programs that read the clipboard themselves. Text paste is unchanged.
- The cursor shape follows DECSCUSR at runtime: the render tick applies a
  changed style to the renderer, leaving the configured cursorStyle in place
  until the application asks.
@neomantra
neomantra merged commit 919b01d into nm-kitty-meow Oct 19, 2026
5 checks passed
@neomantra
neomantra deleted the nm-145 branch October 19, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant