microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.07k stars 8.24k forks source link

Text display area does not scale correctly #11317

Closed zdavidsen closed 2 years ago

zdavidsen commented 3 years ago

Windows Terminal version (or Windows build number)

Windows Terminal version 1.10.2383.0

Other Software

No response

Steps to reproduce

  1. Open Windows terminal (spawns on primary/1080p monitor)
  2. Execute commands till text reaches the bottom of the window
  3. Move window to secondary monitor (4k, 125% scaling)
  4. Text at bottom and right is cut off, and scrolling does not update the bottom of the window
  5. Input is also cut off at the bottom, so I can't see what I'm typing

Expected Behavior

The text display area should scale correctly

Actual Behavior

Window on 1080p monitor: image

Window on 4k monitor: image

Scrolling also seems to only affect the top 3 lines while on the 4k display? image

And there's also something about cutting off the output of commands above the fold, which seems to apply regardless of monitor: image

I also just accidentally discovered that resizing the window fixes both the text display area and the scrolling issue on the 4k monitor

zadjii-msft commented 2 years ago

From #11525: image

zadjii-msft commented 2 years ago
zadjii-msft commented 2 years ago

From @itsamemarkus in 11659

Windows Terminal version (or Windows build number)

1.11.2921.0

Steps to reproduce

Use 4k and lower resolution monitor. Start new terminal session on lower resolution monitor. Drag window from lower resolution monitor to 4k monitor.

https://user-images.githubusercontent.com/34944988/139568896-2e4caeda-0e05-4632-a86e-1195f2e68a17.mp4

Windows Terminal 1.11.2921.0 Windows 21H1 19043.1320

BitsPerPixel : 32
Bounds       : {X=3840,Y=1,Width=1680,Height=1050}
DeviceName   : \\.\DISPLAY1
Primary      : False
WorkingArea  : {X=3840,Y=1,Width=1680,Height=1010}

BitsPerPixel : 32
Bounds       : {X=0,Y=0,Width=1920,Height=1080}
DeviceName   : \\.\DISPLAY2
Primary      : True
WorkingArea  : {X=0,Y=0,Width=1920,Height=1040}

BitsPerPixel : 32
Bounds       : {X=-1680,Y=0,Width=1680,Height=1050}
DeviceName   : \\.\DISPLAY3
Primary      : False
WorkingArea  : {X=-1680,Y=0,Width=1680,Height=1010}
lhecker commented 2 years ago

I have two 4k monitors and set one to 100% and the other to 300% scale. With that setup I can't replicate this issue in Windows Terminal 1.12.10393.0 on Windows 11.

Do we maybe have to swap these two lines? https://github.com/microsoft/terminal/blob/09e99156727a92f84b309f18aee59ea7293b1264/src/cascadia/WindowsTerminal/BaseWindow.h#L112-L114

zadjii-msft commented 2 years ago

See, I dunno about that. I feel like the root cause has got to be somewhere in the TermControl / Renderer area. Look at the screenshot above. The scrollbar is positioned correctly, but seemingly the DX surface isn't? Either the SpawChainPanel didn't get resized up, or the Control didn't resize the actual swapchain to the new size.

It's just annoying that we seemingly can't get a local repro even with a bunch of reports of this 😕 Even if we did have a psychic debugging theory why this happened, we'd have no way to confirm the fix.

itsamemarkus commented 2 years ago

I haven't changed my setup except regular updates and the bug appears to be gone.

Current version where I don't have the bug Windows Terminal 1.11.3471.0 Windows 21H2 19044.1526

Version where I experienced the bug Windows Terminal 1.11.2921.0 Windows 21H1 19043.1320

zadjii-msft commented 2 years ago

Hey anyone who's still hitting this: (@zdavidsen, @flcdrg, @itsamemarkus, I think @oising was as well) - any chance you're using the font object in your profile settings somewhere? The fix in #12492 just has me curious.

zdavidsen commented 2 years ago

Hey anyone who's still hitting this: (zdavidsen, flcdrg, itsamemarkus, I think oising was as well) - any chance you're using the font object in your profile settings somewhere? The fix in 12492 just has me curious.

Huh, changing the font seems to do it. Default is 12, I have all of my profiles set to 10. If I change them back to 12, then the scaling issue goes away. (I only tested it with the cmd profile)

zadjii-msft commented 2 years ago

WHAT

zdavidsen commented 2 years ago

I just double checked and the scrolling issue I mentioned seems to be fixed as well, regardless of text size. Haven't really been watching that one, so I'm not sure when that changed

flcdrg commented 2 years ago

@zadjii-msft my profile is here

The only reference to font is for PowershellCore

               "font": 
                {
                    "face": "CaskaydiaCove NF"
                },

though that is my default profile. I have not changed the font size

lhecker commented 2 years ago

Alright so for some weird reason I can only consistently reproduce it if I do these exact steps:

Horrifying.

oising commented 2 years ago

I'm not sure if this is related, but if I have terminal on my external monitor, then undock, I always get a screwed up/clipped window. Maximize/restore fixes it. I just got used to it. Example:

image

oising commented 2 years ago

And yes, I use a one of the nerdfonts modified Cascadia fonts, I think (for oh-my-posh) -- note that I have force full repaint on for that other bug.

{
    "$help": "https://aka.ms/terminal-documentation",
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "actions": 
    [
        {
            "command": "toggleShaderEffects",
            "keys": "shift+f10"
        },
        {
            "command": "paste",
            "keys": "ctrl+v"
        },
        {
            "command": 
            {
                "action": "copy",
                "singleLine": false
            },
            "keys": "ctrl+c"
        },
        {
            "command": "toggleFocusMode",
            "keys": "shift+f11"
        },
        {
            "command": "unbound",
            "keys": "win+`"
        },
        {
            "command": "find",
            "keys": "ctrl+shift+f"
        },
        {
            "command": 
            {
                "action": "quakeMode"
            },
            "keys": "ctrl+`"
        },
        {
            "command": 
            {
                "action": "splitPane",
                "split": "auto",
                "splitMode": "duplicate"
            },
            "keys": "alt+shift+d"
        }
    ],
    "copyFormatting": "none",
    "copyOnSelect": false,
    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "experimental.rendering.forceFullRepaint": true,
    "experimental.rendering.software": false,
    "profiles": 
    {
        "defaults": 
        {
            "antialiasingMode": "cleartype",
            "colorScheme": "Vintage",
            "font": 
            {
                "face": "FiraCode NF Retina"
            },
            "opacity": 100,
            "useAcrylic": true
        },
        "list": 
        [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "hidden": false,
                "name": "Windows PowerShell"
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "hidden": false,
                "name": "Command Prompt"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "backgroundImage": null,
                "backgroundImageOpacity": 0.75,
                "backgroundImageStretchMode": "fill",
                "colorScheme": "Vintage",
                "commandline": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
                "experimental.retroTerminalEffect": false,
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "intenseTextStyle": "bright",
                "name": "PowerShell",
                "opacity": 100,
                "source": "Windows.Terminal.PowershellCore",
                "useAcrylic": true
            },
            {
                "commandline": "pwsh.exe -noe -c \"&{$vsPath = &(Join-Path ${env:ProgramFiles(x86)} '\\Microsoft Visual Studio\\Installer\\vswhere.exe') -property installationpath; Import-Module (Join-Path $vsPath 'Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll'); Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation}\"",
                "guid": "{febde9c2-43c9-4971-9499-a96a69a6a89b}",
                "icon": "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Assets\\VisualStudio.70x70.contrast-standard_scale-180.png",
                "name": "Developer PowerShell for VS 2019"
            },
            {
                "commandline": "%comspec%  /k \"%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat\"",
                "guid": "{ba122f80-9cdf-47b8-ba11-ce8955bb212f}",
                "icon": "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Assets\\VisualStudio.70x70.contrast-standard_scale-180.png",
                "name": "Developer Command Prompt for VS 2019"
            },
            {
                "colorScheme": "Vintage",
                "guid": "{a3a2e83a-884a-5379-baa8-16f193a13b21}",
                "hidden": false,
                "name": "PowerShell 7 Preview",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl"
            },
            {
                "guid": "{ee76f40e-e821-5b26-819e-d1c8414e1e57}",
                "hidden": false,
                "name": "Developer Command Prompt for VS 2022 [Preview]",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{823e2542-ca2f-5a92-99a7-6bceebe80ef3}",
                "hidden": false,
                "name": "Developer PowerShell for VS 2022 [Preview]",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{f137a298-4fbc-55df-b998-45767d3e5339}",
                "hidden": true,
                "name": "Developer Command Prompt for VS 2019",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{b5e4d867-8168-5ec8-8ac7-38c60e470e4d}",
                "hidden": true,
                "name": "Developer PowerShell for VS 2019",
                "source": "Windows.Terminal.VisualStudio"
            }
        ]
    },
    "schemes": 
    [
        {
            "background": "#0C0C0C",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#CCCCCC",
            "green": "#13A10E",
            "name": "Campbell",
            "purple": "#881798",
            "red": "#C50F1F",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#C19C00"
        },
        {
            "background": "#012456",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#CCCCCC",
            "green": "#13A10E",
            "name": "Campbell Powershell",
            "purple": "#881798",
            "red": "#C50F1F",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#C19C00"
        },
        {
            "background": "#282C34",
            "black": "#282C34",
            "blue": "#61AFEF",
            "brightBlack": "#5A6374",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B6C2",
            "brightGreen": "#98C379",
            "brightPurple": "#C678DD",
            "brightRed": "#E06C75",
            "brightWhite": "#DCDFE4",
            "brightYellow": "#E5C07B",
            "cursorColor": "#FFFFFF",
            "cyan": "#56B6C2",
            "foreground": "#DCDFE4",
            "green": "#98C379",
            "name": "One Half Dark",
            "purple": "#C678DD",
            "red": "#E06C75",
            "selectionBackground": "#FFFFFF",
            "white": "#DCDFE4",
            "yellow": "#E5C07B"
        },
        {
            "background": "#FAFAFA",
            "black": "#383A42",
            "blue": "#0184BC",
            "brightBlack": "#4F525D",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B5C1",
            "brightGreen": "#98C379",
            "brightPurple": "#C577DD",
            "brightRed": "#DF6C75",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#E4C07A",
            "cursorColor": "#4F525D",
            "cyan": "#0997B3",
            "foreground": "#383A42",
            "green": "#50A14F",
            "name": "One Half Light",
            "purple": "#A626A4",
            "red": "#E45649",
            "selectionBackground": "#FFFFFF",
            "white": "#FAFAFA",
            "yellow": "#C18301"
        },
        {
            "background": "#002B36",
            "black": "#002B36",
            "blue": "#268BD2",
            "brightBlack": "#073642",
            "brightBlue": "#839496",
            "brightCyan": "#93A1A1",
            "brightGreen": "#586E75",
            "brightPurple": "#6C71C4",
            "brightRed": "#CB4B16",
            "brightWhite": "#FDF6E3",
            "brightYellow": "#657B83",
            "cursorColor": "#FFFFFF",
            "cyan": "#2AA198",
            "foreground": "#839496",
            "green": "#859900",
            "name": "Solarized Dark",
            "purple": "#D33682",
            "red": "#DC322F",
            "selectionBackground": "#FFFFFF",
            "white": "#EEE8D5",
            "yellow": "#B58900"
        },
        {
            "background": "#FDF6E3",
            "black": "#002B36",
            "blue": "#268BD2",
            "brightBlack": "#073642",
            "brightBlue": "#839496",
            "brightCyan": "#93A1A1",
            "brightGreen": "#586E75",
            "brightPurple": "#6C71C4",
            "brightRed": "#CB4B16",
            "brightWhite": "#FDF6E3",
            "brightYellow": "#657B83",
            "cursorColor": "#002B36",
            "cyan": "#2AA198",
            "foreground": "#657B83",
            "green": "#859900",
            "name": "Solarized Light",
            "purple": "#D33682",
            "red": "#DC322F",
            "selectionBackground": "#FFFFFF",
            "white": "#EEE8D5",
            "yellow": "#B58900"
        },
        {
            "background": "#000000",
            "black": "#000000",
            "blue": "#3465A4",
            "brightBlack": "#555753",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#8AE234",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F",
            "cursorColor": "#FFFFFF",
            "cyan": "#06989A",
            "foreground": "#D3D7CF",
            "green": "#4E9A06",
            "name": "Tango Dark",
            "purple": "#75507B",
            "red": "#CC0000",
            "selectionBackground": "#FFFFFF",
            "white": "#D3D7CF",
            "yellow": "#C4A000"
        },
        {
            "background": "#FFFFFF",
            "black": "#000000",
            "blue": "#3465A4",
            "brightBlack": "#555753",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#8AE234",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F",
            "cursorColor": "#000000",
            "cyan": "#06989A",
            "foreground": "#555753",
            "green": "#4E9A06",
            "name": "Tango Light",
            "purple": "#75507B",
            "red": "#CC0000",
            "selectionBackground": "#FFFFFF",
            "white": "#D3D7CF",
            "yellow": "#C4A000"
        },
        {
            "background": "#000000",
            "black": "#000000",
            "blue": "#000080",
            "brightBlack": "#808080",
            "brightBlue": "#0000FF",
            "brightCyan": "#00FFFF",
            "brightGreen": "#00FF00",
            "brightPurple": "#FF00FF",
            "brightRed": "#FF0000",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#FFFF00",
            "cursorColor": "#FFFFFF",
            "cyan": "#008080",
            "foreground": "#C0C0C0",
            "green": "#008000",
            "name": "Vintage",
            "purple": "#800080",
            "red": "#800000",
            "selectionBackground": "#FFFFFF",
            "white": "#C0C0C0",
            "yellow": "#808000"
        }
    ],
    "startOnUserLogin": true,
    "windowingBehavior": "useAnyExisting"
}
zdavidsen commented 2 years ago

Just in case this helps at all, here's my full profile

ghost commented 2 years ago

:tada:This issue was addressed in #12713, which has now been successfully released as Windows Terminal v1.12.1098.:tada:

Handy links:

ghost commented 2 years ago

:tada:This issue was addressed in #12713, which has now been successfully released as Windows Terminal Preview v1.13.1098.:tada:

Handy links: