Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialRows/initialColumns still doesn't work quite right #8527

Open
angelog0 opened this issue Dec 8, 2020 · 17 comments · Fixed by #8584
Open

initialRows/initialColumns still doesn't work quite right #8527

angelog0 opened this issue Dec 8, 2020 · 17 comments · Fixed by #8584
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@angelog0
Copy link

angelog0 commented Dec 8, 2020

By default WT starts with `"initialRows": 30', and this is true when there is not the tab row. After opening the first tab, tha tab row shows up and WT really displays 28 rows (it conserves the window height).

Is there an option to conserve the `initiaRows', 30, for example? (the window height should increase a bit).

@angelog0 angelog0 added the Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs label Dec 8, 2020
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 8, 2020
@zadjii-msft
Copy link
Member

We were originally tracking this with #2061. I thought this was fixed in #4825. Are you using "showTabsInTitlebar": false?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 9, 2020
@angelog0
Copy link
Author

angelog0 commented Dec 9, 2020

Are you using "showTabsInTitlebar": false

I use:

"alwaysShowTabs": false, 
"showTabsInTitlebar": false,

and want a title bar + a tab bar(when there are tabs) + 30 rows (always): the terminal should increase its vertical dimension when tab bar shows up so that it displays always 30 rows of text.

The current behavior is that the vertical dimension is static and when tab row shows up the space of 2 rows are taken by the tab row so that the true text displayed is 28 rows.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Dec 9, 2020
@ghost
Copy link

ghost commented Dec 14, 2020

S stands for showTabsInTitlebar
A stands for alwaysShowTabs
T stands for true
F stands for false

  • Using both properties
    S A
    T T 30
    T F 30
    F T 28
    F F 30

  • Using one of the property(e.g only showTabsInTitlebar or only alwaysShowTabs)
    showTabsInTitlebar: true -> 30
    showTabsInTitlebar: false -> 28
    alwaysShowTabs true -> 30
    alwaysShowTabs: false -> 30

It seems like there are two cases that would make row only 28. For my machine settings both false shows 30 rows.
Do you want these two cases would show 30 rows as well ?

@ghost ghost added the In-PR This issue has a related PR label Dec 14, 2020
@zadjii-msft
Copy link
Member

Just for legibility's sake:

showTabsInTitlebar alwaysShowTabs rows
T T 30
T F 30
F T 28
F F 30

I'm pretty sure that this is just a coincidence that it's 2 rows. If the font size is bigger or smaller, you might end up seeing only one row of difference, or 3 rows.

Plus, I think we should already be handling this:

// GH#2061 - If the global setting "Always show tab bar" is
// set or if "Show tabs in title bar" is set, then we'll need to add
// the height of the tab bar here.
if (_settings.GlobalSettings().ShowTabsInTitlebar())
{
// If we're showing the tabs in the titlebar, we need to use a
// TitlebarControl here to calculate how much space to reserve.
//
// We'll create a fake TitlebarControl, and we'll propose an
// available size to it with Measure(). After Measure() is called,
// the TitlebarControl's DesiredSize will contain the _unscaled_
// size that the titlebar would like to use. We'll use that as part
// of the height calculation here.
auto titlebar = TitlebarControl{ static_cast<uint64_t>(0) };
titlebar.Measure({ SHRT_MAX, SHRT_MAX });
proposedSize.Height += (titlebar.DesiredSize().Height) * scale;
}
else if (_settings.GlobalSettings().AlwaysShowTabs())
{
// Otherwise, let's use a TabRowControl to calculate how much extra
// space we'll need.
//
// Similarly to above, we'll measure it with an arbitrarily large
// available space, to make sure we get all the space it wants.
auto tabControl = TabRowControl();
tabControl.Measure({ SHRT_MAX, SHRT_MAX });
// For whatever reason, there's about 6px of unaccounted-for space
// in the application. I couldn't tell you where these 6px are
// coming from, but they need to be included in this math.
proposedSize.Width += (tabControl.DesiredSize().Height + 6) * scale;
}

I'd guess that since that code was written, something in the TabRowControl regressed. Maybe a MUX update changed how a TabView Measures without any tabs in it. Can't say for sure. But I'd start by investigating why that code path is returning the wrong value.

@DHowett DHowett changed the title About initial rows initialRows/initialColumns still doesn't work quite right Dec 15, 2020
@DHowett DHowett added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. and removed Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 15, 2020
@DHowett DHowett added this to the Terminal Backlog milestone Dec 15, 2020
@DHowett
Copy link
Member

DHowett commented Dec 15, 2020

@zadjii-msft Backlogged. Yanked triage.

@ghost ghost closed this as completed in #8584 Dec 15, 2020
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 15, 2020
ghost pushed a commit that referenced this issue Dec 15, 2020
DHowett pushed a commit that referenced this issue Jan 25, 2021
Closes #8527

(cherry picked from commit e943785)
@ghost
Copy link

ghost commented Jan 28, 2021

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

Handy links:

@ghost
Copy link

ghost commented Jan 28, 2021

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

Handy links:

mpela81 pushed a commit to mpela81/terminal that referenced this issue Jan 28, 2021
@angelog0
Copy link
Author

This issue was addressed in #8584, which has now been successfully released as Windows Terminal v1.5.10271.0

I am afraid but WT 1.5.10271.0 has the same issue: only when WT starts without tabs row has 30 lines; with tabs row it has 28 lines.

Maybe you meant the preview 1.6 has fixed this issue.. I do not use that...

@angelog0
Copy link
Author

Attached some example

@zadjii-msft
Copy link
Member

I'm guessing that this is only fixed in 1.6 Preview. I'm not sure which changes @DHowett brought down to 1.5, but this was definitely fixed in the 1.6 timeframe...

@DHowett
Copy link
Member

DHowett commented Feb 3, 2021

No, 9e9c0be is in the release-1.5 branch. That was the fix for this issue. I'm guessing that you'd be seeing this in 1.6 if you were using it.

@angelog0
Copy link
Author

angelog0 commented Feb 3, 2021

No, 9e9c0be is in the release-1.5 branch. That was the fix for this issue. I'm guessing that you'd be seeing this in 1.6 if you were using it.

Then the issue is not fixed, as my screenshots proof... (I don't use preview)

@angelog0
Copy link
Author

angelog0 commented Feb 3, 2021

No, 9e9c0be is in the release-1.5 branch.

If I understood that code, it is not the fix for the issue I flagged here...

The issue I flagged here would need to resize the window height when tabs are visible to conserve the same initial rows...

@DHowett
Copy link
Member

DHowett commented Mar 30, 2021

I don't know if we ever drove this to ground, so I'm reopening it.

@DHowett DHowett reopened this Mar 30, 2021
@angelog0
Copy link
Author

Not, at least in v. 1.6.10571.0...

@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
@zadjii-msft
Copy link
Member

idly: I wonder if the scrollbar size change is gonna Mess this up even more, if scrollbars are no longer SM_CXVSCROLL

@zadjii-msft zadjii-msft removed the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Feb 7, 2022
@zadjii-msft zadjii-msft modified the milestones: Backlog, 22H2 Feb 7, 2022
@zadjii-msft zadjii-msft added the Priority-2 A description (P2) label Feb 7, 2022
@yujinlin0224
Copy link

yujinlin0224 commented Jun 19, 2023

This issue still happened in version 1.17.11461.0

bandicam.2023-06-19.14-14-24-861.mp4

Here is my settings:

{
    "$help": "https://aka.ms/terminal-documentation",
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "windowingBehavior": "useExisting",
    "initialCols": 120,
    "initialRows": 40,
    "centerOnLaunch": true,
    "disabledProfileSources": [
        "Windows.Terminal.Azure"
    ],
    "copyFormatting": "all",
    "largePasteWarning": false,
    "multiLinePasteWarning": false,
    "theme": "Mica",
    "themes": [
        {
            "name": "Mica",
            "window": {
                "applicationTheme": "system",
                "useMica": true
            },
            "tab": {
                "background": "#00000040",
                "unfocusedBackground": "#00000000"
            },
            "tabRow": {
                "background": "#00000000",
                "unfocusedBackground": "#00000000"
            }
        }
    ],
    "schemes": [
        {
            "name": "VSCode Dark+",
            "foreground": "#cccccc",
            "background": "#252526",
            "selectionBackground": "#264f78",
            "cursorColor": "#cccccc",
            "black": "#000000",
            "red": "#cd3131",
            "green": "#0dbc79",
            "yellow": "#e5e510",
            "blue": "#2472c8",
            "purple": "#bc3fbc",
            "cyan": "#11a8cd",
            "white": "#e5e5e5",
            "brightBlack": "#666666",
            "brightRed": "#f14c4c",
            "brightGreen": "#23d18b",
            "brightYellow": "#f5f543",
            "brightBlue": "#3b8eea",
            "brightPurple": "#d670d6",
            "brightCyan": "#29b8db",
            "brightWhite": "#e5e5e5"
        },
        {
            "name": "VSCode Light+",
            "foreground": "#333333",
            "background": "#f3f3f3",
            "selectionBackground": "#add6ff",
            "cursorColor": "#333333",
            "black": "#000000",
            "red": "#cd3131",
            "green": "#00bc00",
            "yellow": "#949800",
            "blue": "#0451a5",
            "purple": "#bc05bc",
            "cyan": "#0598bc",
            "white": "#555555",
            "brightBlack": "#666666",
            "brightRed": "#cd3131",
            "brightGreen": "#14ce14",
            "brightYellow": "#b5ba00",
            "brightBlue": "#0451a5",
            "brightPurple": "#bc05bc",
            "brightCyan": "#0598bc",
            "brightWhite": "#a5a5a5"
        }
    ],
    "profiles": {
        "defaults": {
            "colorScheme": "VSCode Dark+",
            "font": {
                "face": "Sarasa Term TC",
                "size": 10,
                "features": {
                    "cv10": 6,
                    "cv31": 16,
                    "cv35": 6,
                    "cv42": 10,
                    "cv44": 2,
                    "cv49": 2,
                    "cv72": 3,
                    "cv77": 2,
                    "cv80": 2,
                    "cv82": 6,
                    "cv88": 2,
                    "cv93": 3
                }
            },
            "cursorShape": "bar",
            "opacity": 25,
            "padding": "6, 6, 6, 6",
            "background": "#000000",
            "unfocusedAppearance": {
                "background": "#202020",
            },
            "antialiasingMode": "cleartype",
            "historySize": 32767,
            "bellStyle": [
                "window",
                "taskbar"
            ],
            "experimental.autoMarkPrompts": true,
            "experimental.showMarksOnScrollbar": true,
            "experimental.rightClickContextMenu": true,
        },
        "list": [
            {
                "name": "PowerShell",
                "commandline": "pwsh -NoLogo",
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "name": "Windows PowerShell",
                "hidden": true,
                "commandline": "powershell -NoLogo",
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}"
            },
            {
                "name": "Command Prompt",
                "commandline": "cmd /k %UserProfile%\\.cmdrc.bat",
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
            },
            {
                "name": "Git Bash",
                "commandline": "%ProgramFiles%\\Git\\bin\\bash.exe -il",
                "startingDirectory": "%UserProfile%",
                "icon": "%ProgramFiles%\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "guid": "{d15b228a-05d7-50d1-8472-f60aaba86efc}"
            },
            {
                "name": "WSL",
                "hidden": true,
                "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
                "source": "Windows.Terminal.Wsl"
            },
            {
                "name": "Ubuntu (WSL)",
                "commandline": "wsl -d Ubuntu",
                "startingDirectory": "~",
                "guid": "{51855cb2-8cce-5362-8f54-464b92b32386}",
                "source": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc"
            }
        ]
    }
}

I am using Windows 11 10.0.22621.1702, and a 4K monitor with 150% scaling.
Now I set "initialRows": 36, to temporary fix the issue.

@zadjii-msft zadjii-msft modified the milestones: 22H2, Backlog Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants