Skip to content

fix(web): prevent browser from capturing Tab and other reserved keys#126

Merged
mathiasbourgoin merged 1 commit intomainfrom
fix/web-tab-key
Feb 26, 2026
Merged

fix(web): prevent browser from capturing Tab and other reserved keys#126
mathiasbourgoin merged 1 commit intomainfrom
fix/web-tab-key

Conversation

@mathiasbourgoin
Copy link
Collaborator

Summary

  • Add ev.preventDefault() in the web client keyboard handler when a key is recognized, so the browser does not also act on it (Tab for focus navigation, F5 for reload, etc.)
  • Fix test_canvas empty-canvas ANSI test to match the new SGR-at-col-0 behaviour introduced in 0.4.2

Test plan

  • Build passes (dune build)
  • All tests pass (dune test)
  • Manual: open Miaou in web mode, verify Tab reaches the application instead of shifting browser focus

Call ev.preventDefault() when a key is recognized in the web client's
keyboard handler. Previously Tab triggered browser focus navigation
instead of reaching the Miaou application.

Also fix test_canvas: update expected ANSI output for empty canvas to
include the SGR reset emitted at col 0 since the 0.4.2 row-isolation fix.
@mathiasbourgoin mathiasbourgoin merged commit 1d52f39 into main Feb 26, 2026
1 check passed
@mathiasbourgoin mathiasbourgoin deleted the fix/web-tab-key branch February 26, 2026 15:29
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