Terminal: Left side of text is cut off when maximizing windows terminal on non-primary monitor

Created on 29 May 2019  路  20Comments  路  Source: microsoft/terminal

Environment

Windows build number: [run "ver" at a command prompt]
Windows Terminal version (if applicable):

Any other software?

Microsoft Windows [Version 10.0.18892.1001]

Steps to reproduce

Press the maximize button when the terminal is on a non-primary monitor

Expected behavior

All text should be visible

Actual behavior

A portion of the leftmost column of cells is cut off.

The text is fine when maximized on the primary monitor.

Area-User Interface Help Wanted Issue-Bug Product-Terminal Resolution-Fix-Committed

Most helpful comment

I believe it has to do with this block where the _maximizedMargins is calculated. This check

if (rcMaximum.left == 0)
{
    offset = windowPos->x;
}
else if (rcMaximum.top == 0)
{
    offset = windowPos->y;
}

does not work for non primary monitors that are positioned with an offset where left and top won't be 0.

What I mean by not monitors aligned.
ApplicationFrameHost_nnfjcbW3g4
I can reproduce the issue with an arrangement like in the above example. If I change it so that they are arranged side-by-side, then rcMaximum.top becomes 0 and it maximizes properly on the second monitor.

All 20 comments

I hope I can provide more information.

For me, this happens when using it on the second display on a dual monitor setup of primary 2560脳1440 and secondary 1920x1080. When using two equal displays with 1920x1080, it doesn't happen at all.

Also, it seems that when using it in the first setup, the + button on the titlebar is cut off at the top (possibly the entire titlebar). But in the second setup, it's totally fine.

I can reproduce this only with the showTabsInTitlebar setting enabled. It looks like about 10px from the top and left are being cut off.

I can reproduce on Surface Pro with 19" external monitor (with or without showTabsInTitlebar setting enabled) with all terminal types,
TerminalExternalLeft

1920x1080 primary display and 3840x2160 non-primary monitor, each has a high DPI scaling factor of 150%.

Terminal on non-primary monitor, left and top is cut off.
灞忓箷鎴浘(15)

Terminal on primary monitor, everything is good.
灞忓箷鎴浘(16)

Seeing this issue on Dell Precision 5520 with Intel and Nvidia GPUs. Internal screen 1920x1080, external screen one 1920x1080, external screen two 3840x2160. Internal screen is set as primary.

Only see this issue on the 3840x2160 (4K) display. Scaling factor doesn't seem to affect it (tried 100%, 150%, 175%).

Orientation of the screens doesn't obviously make a difference. Normally I have Left (scr two) - Middle (Internal) - Right (scr one). Switched the external screens around so that Windows thinks screen two is on the right, and the issue stays with screen two (the 4K one).

Occurs with PowerShell, PowerShell Core, Windows Cmd, and Ubuntu sessions, including those started after the window is maximised.

After my initial post on Friday, when I first noticed the problem, I tried again on Sunday (yesterday) and it was working fine. I don't know why it changed, and I don't think there was an update. However, I am glad it is now working. The external monitor is an older 1280x1024 while the main Surface Pro display is 2736x1824. I give those details for context.

Still seeing the issue here.

I am also suffering with this issue. All of my monitors are the same resolution and scale. (The only difference is the colour profile of the monitor.

I am also seeing the bottom of the terminal cut off by taskbar as well as the left side on my non-primary monitor
image

Just FYI, I tried this locally.

It is working fine on my non-primary monitors.
When I change the DPI/scaling of my monitors, it's still OK.

I still will have to go get the 4K monitor and test that way.
And then I'll try with a Surface device and an external monitor after that.

@miniksa Is there any information we can provide to help track down the cause?

Windows 10.0.18362.207
Terminal 0.2.1715.0 from the Store

My setup is a 1920脳1080 main screen and a 1600脳900 screen to the left, both at 100% scaling. In the main screen there is no problem, but the problem described in this issue happens in the secondary monitor, at the top, left, and bottom of the window.

@gmckeown, that's a catch-22. If I knew what could help, I'd probably know what was going wrong. Right now, it's just a mystery to me so I need to see it happening and get a debugger on it, or find someone with this issue externally who has the confidence to debug it themselves and tell us what's going wrong.

OK, it does repro on the 4K monitor I found around here. I'll debug it.

I believe it has to do with this block where the _maximizedMargins is calculated. This check

if (rcMaximum.left == 0)
{
    offset = windowPos->x;
}
else if (rcMaximum.top == 0)
{
    offset = windowPos->y;
}

does not work for non primary monitors that are positioned with an offset where left and top won't be 0.

What I mean by not monitors aligned.
ApplicationFrameHost_nnfjcbW3g4
I can reproduce the issue with an arrangement like in the above example. If I change it so that they are arranged side-by-side, then rcMaximum.top becomes 0 and it maximizes properly on the second monitor.

@dsafa I think that fits with my issue. Normally I use:

image

With this, I get the alignment issue. If I change to:

image

The problem isn't seen.

Can confirm this also happens if the monitor alignment in display settings is not aligned to the top or bottom of the main monitor exactly. Thanks for the fix @dsafa

Confirmed. This is my setup, and the issue happens when the window is in monitor 2. If I align the screen to the top of the other, then the issue disappears once I restore and maximize the window again. Notice that this happens to me even when the bottom of the secondary screen is aligned with the bottom of the main screen (it only disappears when the tops of both screens are aligned).

image

If its not picked up, I can try and get a PR done later.

:tada:This issue was addressed in #1921, which has now been successfully released as Windows Terminal Preview v0.3.2142.0.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdtauk picture mdtauk  路  3Comments

dev-logan picture dev-logan  路  3Comments

miniksa picture miniksa  路  3Comments

warpdesign picture warpdesign  路  3Comments

carlos-zamora picture carlos-zamora  路  3Comments