Skip to content

Inconsistent gutters/margins on HiDPI displays with snapToGridOnResize #4175

Open

Description

It looks like on my 200% scale device it's snapping at the half-grid.


A 50x15 window at 150% scale with Ctrl+Shift+A:
image

After resizing the window to 51x15:
image

Activity

  1. added
    Help WantedWe encourage anyone to jump in on these.
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
    Area-SettingsIssues related to settings and customizability, for console or terminal
    on Jan 10, 2020
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jan 10, 2020
  3. randomascii commented on Mar 28, 2020

    @randomascii

    At 125% scaling it seems to have a variable padding at the bottom. As you size the window up from the bottom, one line at a time, it actually shrinks the window by some lesser amount - probably 80% of a line.

    Even at 100% it is not totally reliable. When you expand the height of the window the newly revealed line will sometimes not render (even though there is content there) but if you scroll up and down the content will appear.

  4. 14 remaining items

  5. DHowett commented on Aug 22, 2023

    @DHowett
  6. egorlepa commented on Aug 25, 2023

    @egorlepa
  7. changed the title [-]`snapToGridOnResize` gets grid size wrong on HiDPI devices[/-] [+]Inconsistent gutters/margins on HiDPI displays with `snapToGridOnResize`[/+] on Aug 30, 2023
  8. zadjii-msft commented on Aug 31, 2023

    @zadjii-msft
    Member

    float TermControl::SnapDimensionToGrid(const bool widthOrHeight, const float dimension)
    {
    const auto fontSize = _core.FontSize();
    const auto fontDimension = widthOrHeight ? fontSize.Width : fontSize.Height;
    const auto padding = GetPadding();
    auto nonTerminalArea = gsl::narrow_cast<float>(widthOrHeight ?
    padding.Left + padding.Right :
    padding.Top + padding.Bottom);
    if (widthOrHeight && _core.Settings().ScrollState() != ScrollbarState::Hidden)
    {
    nonTerminalArea += gsl::narrow_cast<float>(ScrollBar().ActualWidth());
    }
    const auto gridSize = dimension - nonTerminalArea;
    const auto cells = floor(gridSize / fontDimension);
    return cells * fontDimension + nonTerminalArea;
    }

    Pretty sure this just doesn't account for DIPs vs pixels at all. Never has. I'd reckon that dimension is in DIPs and fontSize is in pixels. Someone could pretty easily fix that

  9. rp1231 commented on Feb 22, 2024

    @rp1231

    Screenshot 2024-02-22 113426
    I'm having this problem as well on a 4k display.
    Used a white background to show the borders.
    Is there any way to totally get rid of the borders from all sides?

  10. MarcoBuess commented on Jan 7, 2025

    @MarcoBuess

    Seeing that this is open for almost a year, is this still being worked on? As it seems its still relevant. #17721 mentions 1.23 as a potential candidate that adresses this, am I understanding correctly?

  11. Ali-Nu commented on Jan 7, 2025

    @Ali-Nu
  12. B1LLP4RK commented on Jul 9, 2025

    @B1LLP4RK

    I'm still waiting for this to be fixed

  13. FY0u11 commented on Oct 15, 2025

    @FY0u11

    5 years. Any progress on this?

  14. kahilah commented on Dec 29, 2025

    @kahilah

    Can confirm, still an issue with latest terminal version.

  15. shivam-dhir commented on Jan 22, 2026

    @shivam-dhir
  16. VishalGujela commented on Mar 19, 2026

    @VishalGujela

    I would like to contribute on this as my first opensource project.
    Can i?

  17. aaryanm1208-ship-it commented on Nov 7, 2026

    @aaryanm1208-ship-it

    Hi! I'd like to investigate and work on this issue as my first contribution to Windows Terminal.

    I'll first reproduce the issue, inspect the current SnapDimensionToGrid implementation, and investigate the DIP-versus-pixel scaling behaviour before proposing a fix.

    Please let me know if there are any specific considerations before I proceed. Thank you!

  18. DHowett commented on Nov 8, 2026

    @DHowett
    Member

    considerations

    Follow our AI guidelines and we won't have a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssues related to settings and customizability, for console or terminalArea-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Help WantedWe encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-3A description (P3)Product-TerminalThe new Windows Terminal.good first issueThis is a fix that might be easier for someone to do as a first contribution

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions