Inconsistent gutters/margins on HiDPI displays with snapToGridOnResize #5850

Open
opened 2026-01-31 00:23:23 +00:00 by claunia · 14 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Jan 10, 2020).

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

Originally created by @DHowett-MSFT on GitHub (Jan 10, 2020). 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](https://github.com/microsoft/terminal/assets/2256941/141f7b81-3fde-4fff-8b94-323dadb0c56b) After resizing the window to 51x15: ![image](https://github.com/microsoft/terminal/assets/2256941/69a06f9d-f245-48bc-80fc-2718c293bb1d)
Author
Owner

@randomascii commented on GitHub (Mar 28, 2020):

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.

@randomascii commented on GitHub (Mar 28, 2020): 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.
Author
Owner

@MVS-99 commented on GitHub (Dec 28, 2022):

Is there a solution yet for this kind of issue??? Mostly appears when changing terminal from one screen to another.

@MVS-99 commented on GitHub (Dec 28, 2022): Is there a solution yet for this kind of issue??? Mostly appears when changing terminal from one screen to another.
Author
Owner

@meshkinyar commented on GitHub (Jan 3, 2023):

Is there a solution yet for this kind of issue??? Mostly appears when changing terminal from one screen to another.

A hacky solution I found is creating a PNG that is just filled with your set background color and then setting that to the background image of your current profile. No random padding (at least any that's visible anyway).

The space seems to be leftover padding for the scrollbars that just isn't cleaned due to display scaling. It's just strange that having an image background seems to hide this problem. My guess is that the problem is visible due to there being an unset "application background" that the terminal is rendered on top of when not set to an image. In my case it could also be an out-of-gamut accent color but I really don't know.

@meshkinyar commented on GitHub (Jan 3, 2023): > Is there a solution yet for this kind of issue??? Mostly appears when changing terminal from one screen to another. A hacky solution I found is creating a PNG that is just filled with your set background color and then setting that to the background image of your current profile. No random padding (at least any that's visible anyway). The space seems to be leftover padding for the scrollbars that just isn't cleaned due to display scaling. It's just strange that having an image background seems to hide this problem. My guess is that the problem is visible due to there being an unset "application background" that the terminal is rendered on top of when not set to an image. In my case it could also be an out-of-gamut accent color but I really don't know.
Author
Owner

@egorlepa commented on GitHub (Aug 22, 2023):

125% scaling
image
pls fix :)

@egorlepa commented on GitHub (Aug 22, 2023): 125% scaling ![image](https://github.com/microsoft/terminal/assets/76429849/3783d11f-5014-4cbe-bf61-5fc311aafafa) pls fix :)
Author
Owner

@DHowett commented on GitHub (Aug 22, 2023):

125% scaling pls fix :)

I'm sorry, we can't snap your monitor size to the number of characters that would fit in your terminal viewport. When Terminal is maximized, the window must cover the entire screen. Unless you have a resizable monitor, we will not be able do to anything about it. On any DPI.

@DHowett commented on GitHub (Aug 22, 2023): > 125% scaling pls fix :) I'm sorry, we can't snap your monitor size to the number of characters that would fit in your terminal viewport. When Terminal is maximized, _the window must cover the entire screen_. Unless you have a resizable monitor, we will not be able do to anything about it. On _any_ DPI.
Author
Owner

@egorlepa commented on GitHub (Aug 25, 2023):

Resizable monitor sounds like a great idea. Until we are there i'd prefer this last characters to go out of bounds a bit, or maybe at least center what fits?

@egorlepa commented on GitHub (Aug 25, 2023): Resizable monitor sounds like a great idea. Until we are there i'd prefer this last characters to go out of bounds a bit, or maybe at least center what fits?
Author
Owner

@zadjii-msft commented on GitHub (Aug 31, 2023):

636be7e514/src/cascadia/TerminalControl/TermControl.cpp (L2415-L2433)

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

@zadjii-msft commented on GitHub (Aug 31, 2023): https://github.com/microsoft/terminal/blob/636be7e514e243810e8944a61f5cf7044d316e05/src/cascadia/TerminalControl/TermControl.cpp#L2415-L2433 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
Author
Owner

@rp1231 commented on GitHub (Feb 22, 2024):

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?

@rp1231 commented on GitHub (Feb 22, 2024): ![Screenshot 2024-02-22 113426](https://github.com/microsoft/terminal/assets/47380919/5b7fa727-8faf-4f0c-93d8-c7bbed4490b4) 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?
Author
Owner

@MarcoBuess commented on GitHub (Jan 7, 2025):

Seeing that this is open for almost a year, is this still being worked on? As it seems its still relevant. https://github.com/microsoft/terminal/pull/17721 mentions 1.23 as a potential candidate that adresses this, am I understanding correctly?

@MarcoBuess commented on GitHub (Jan 7, 2025): Seeing that this is open for almost a year, is this still being worked on? As it seems its still relevant. https://github.com/microsoft/terminal/pull/17721 mentions `1.23` as a potential candidate that adresses this, am I understanding correctly?
Author
Owner

@Ali-Nu commented on GitHub (Jan 7, 2025):

No, it's not.

вт, 7 янв. 2025 г., 14:53 Marco Bueß @.***>:

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


Reply to this email directly, view it on GitHub
https://github.com/microsoft/terminal/issues/4175#issuecomment-2574845440,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BOAUGLPLZMNA4QO3ABKCRX32JOPZHAVCNFSM6AAAAABUXK5C66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZUHA2DKNBUGA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

@Ali-Nu commented on GitHub (Jan 7, 2025): No, it's not. вт, 7 янв. 2025 г., 14:53 Marco Bueß ***@***.***>: > Seeing that this is open for almost a year, is this still being worked on? > As it seems its still relevant. #17721 > <https://github.com/microsoft/terminal/pull/17721> mentions 1.23 as a > potential candidate that adresses this, am I understanding correctly? > > — > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/4175#issuecomment-2574845440>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/BOAUGLPLZMNA4QO3ABKCRX32JOPZHAVCNFSM6AAAAABUXK5C66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZUHA2DKNBUGA> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@B1LLP4RK commented on GitHub (Jul 9, 2025):

I'm still waiting for this to be fixed

@B1LLP4RK commented on GitHub (Jul 9, 2025): I'm still waiting for this to be fixed
Author
Owner

@FY0u11 commented on GitHub (Oct 15, 2025):

5 years. Any progress on this?

@FY0u11 commented on GitHub (Oct 15, 2025): 5 years. Any progress on this?
Author
Owner

@kahilah commented on GitHub (Dec 29, 2025):

Can confirm, still an issue with latest terminal version.

@kahilah commented on GitHub (Dec 29, 2025): Can confirm, still an issue with latest terminal version.
Author
Owner

@shivam-dhir commented on GitHub (Jan 22, 2026):

Hi, I would love to work on this issue

@shivam-dhir commented on GitHub (Jan 22, 2026): Hi, I would love to work on this issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5850