terminal icon indicating copy to clipboard operation
terminal copied to clipboard

`snapToGridOnResize` gets grid size wrong on HiDPI devices

Open DHowett-MSFT opened this issue 5 years ago • 3 comments

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

DHowett-MSFT avatar Jan 10 '20 02:01 DHowett-MSFT

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 avatar Mar 28 '20 00:03 randomascii

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

MVS-99 avatar Dec 28 '22 19:12 MVS-99

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 avatar Jan 03 '23 06:01 meshkinyar

125% scaling image pls fix :)

egorlepa avatar Aug 22 '23 08:08 egorlepa

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 avatar Aug 22 '23 22:08 DHowett

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 avatar Aug 25 '23 22:08 egorlepa

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

zadjii-msft avatar Aug 31 '23 10:08 zadjii-msft

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 avatar Feb 22 '24 06:02 rp1231