Skip to content

Terminal: Missing devicePixelRatio listener causes misalignment on zoom #309160

@ammaarrahmed

Description

@ammaarrahmed

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.115.0
  • OS Version: Ubuntu 24.04.4 LTS

Steps to Reproduce:

  1. Open VS Code and open the integrated terminal in the panel.
  2. Change the editor's zoom level using the keyboard shortcuts (Ctrl + + or Ctrl + -).
  3. Observe the bug: The terminal canvas fails to repaint and align correctly with the new zoom dimensions. Depending on the zoom direction, the prompt text gets severely clipped at the top, disappears entirely out of the viewport bounds, or renders with excessive blank space above it. The inline suggestion ghost text also detaches and floats in the wrong position.
  4. Switch to a different panel tab (e.g., "PORTS" or "OUTPUT") and switch back to "TERMINAL".
  5. Observe the workaround: Forcing this tab switch triggers a re-render, causing the terminal canvas to properly recalculate its dimensions and fix the alignment.

Testing on main build

I also tested existence of this issue on my fork by building on main , issue still persists.

Media:

Screencast.from.2026-04-11.09-51-59.webm

PR Ready

Note to maintainers: I have already investigated the root cause of this issue (the terminal instance is missing a listener for window.devicePixelRatio / zoom level changes, causing it to use stale dimensions for the canvas renderer until a manual layout refresh is triggered). I have a Pull Request ready to go that implements this fix and will link it to this issue immediately after opening. I would love to contribute to vscode given the opportunity!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions