Skip to content

Fix: Mac terminal appears blurred in high zoom levels#2721

Merged
abose merged 4 commits intomainfrom
st
Mar 4, 2026
Merged

Fix: Mac terminal appears blurred in high zoom levels#2721
abose merged 4 commits intomainfrom
st

Conversation

@abose
Copy link
Member

@abose abose commented Mar 4, 2026

Blur Fix - Mac only

<not issue in electron/Tauri Edge(chrome) based browsers.
Tauri mac native zoom does not update window.devicePixelRatio, causing the xterm.js WebGL canvas to render at 1x resolution regardless of zoom level. The native zoom then upscales the bitmap, producing blurry terminal text at zoom levels above 100%.

Fix by overriding the devicePixelRatio getter in zoomWebView() to reflect the effective DPR (baseDPR * zoomFactor). The terminal detects DPR changes during fit() and calls clearTextureAtlas() to rebuild glyphs at the new resolution. Also guards _cropDataUrlToRect to use the original base DPR so screenshot cropping is unaffected.

Zoom UI HUD

image

abose added 4 commits March 4, 2026 07:54
…zoomed

Tauri/Electron native zoom does not update window.devicePixelRatio,
causing the xterm.js WebGL canvas to render at 1x resolution regardless
of zoom level. The native zoom then upscales the bitmap, producing
blurry terminal text at zoom levels above 100%.

Fix by overriding the devicePixelRatio getter in zoomWebView() to
reflect the effective DPR (baseDPR * zoomFactor). The terminal detects
DPR changes during fit() and calls clearTextureAtlas() to rebuild
glyphs at the new resolution. Also guards _cropDataUrlToRect to use
the original base DPR so screenshot cropping is unaffected.
The devicePixelRatio override breaks on Chrome-based Electron and
Tauri on other platforms. Restrict it to macOS + Tauri where the
native webview zoom does not update DPR.
Add NotificationUI.showHUD() for centered, macOS-style HUD notifications
with icon and label. Used by zoom commands to display a magnifying glass
icon with the current zoom percentage that auto-dismisses after 1 second.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@abose abose merged commit af0041e into main Mar 4, 2026
17 of 21 checks passed
@abose abose deleted the st branch March 4, 2026 05:27
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