Skip to content

feat: runtime font-size zoom via Ctrl/Cmd +/-/0#25

Merged
jesse23 merged 9 commits intomainfrom
jesse_dnd
Mar 31, 2026
Merged

feat: runtime font-size zoom via Ctrl/Cmd +/-/0#25
jesse23 merged 9 commits intomainfrom
jesse_dnd

Conversation

@jesse23
Copy link
Copy Markdown
Owner

@jesse23 jesse23 commented Mar 31, 2026

Summary

  • Add in-session font-size zoom via Ctrl/Cmd + =/-/0, matching VS Code and native terminal conventions
  • Uses term.options.fontSize (xterm.js options-proxy pattern) to trigger ghostty-web's internal renderer update
  • Fix key leak: add stopPropagation() so zoom keys are not forwarded to the PTY as literal characters

Changes

  • src/client/index.ts — attach window capture-phase keydown handler for zoom; preventDefault() stops browser page-zoom, stopPropagation() stops ghostty-web from forwarding the key to the PTY
  • docs/adrs/023.client.font-size-zoom.md — ADR documenting the decision

Related ADRs

  • ADR 023 — this feature
  • ADR 022 — fit() is called after each zoom step to recentre the canvas

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a client-side, in-session font-size zoom feature (Ctrl/Cmd + = / - / 0) to adjust the Ghostty terminal’s fontSize at runtime, while preventing those keystrokes from being forwarded to the PTY. Includes an ADR documenting the approach and tradeoffs.

Changes:

  • Add a capture-phase window keydown handler to implement zoom-in / zoom-out / reset and call fit() after each step.
  • Stop zoom shortcut keystrokes from leaking to the PTY via stopPropagation().
  • Add ADR 023 documenting the decision and rationale.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/client/index.ts Implements runtime font zoom via term.options.fontSize and global key interception.
docs/adrs/023.client.font-size-zoom.md Documents the decision, constraints, and rationale for the chosen implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jesse23 jesse23 merged commit 0c03170 into main Mar 31, 2026
3 checks passed
@jesse23 jesse23 deleted the jesse_dnd branch March 31, 2026 21:30
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.

2 participants