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

one line moved up when maximizing Terminal #13961

Closed
jackyzy823 opened this issue Sep 10, 2022 · 3 comments · Fixed by #17058
Closed

one line moved up when maximizing Terminal #13961

jackyzy823 opened this issue Sep 10, 2022 · 3 comments · Fixed by #17058
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@jackyzy823
Copy link

Windows Terminal version

1.14.2281.0

Windows build number

10.0.19042.1526

Other Software

No response

Steps to reproduce

Make Terminal in maximized status and prompt in the last line
before

Then just minimize and maximize by click Taskbar twice

after

It is obviously a line moved up.

Then just type some char
afterandinput

Repeat above steps
afterandinput_repeat

Expected Behavior

The prompt still in the last line , not automatically (wrongly) move up one line after maximize.

Actual Behavior

It moves up one line.

@jackyzy823 jackyzy823 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Sep 10, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 10, 2022
@carlos-zamora carlos-zamora added Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Product-Terminal The new Windows Terminal. Priority-3 A description (P3) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 22, 2023
@carlos-zamora carlos-zamora added this to the Backlog milestone Mar 22, 2023
@zadjii-msft
Copy link
Member

Some cursory notes:

  • The PsReadline cursor position is wrong, but that was fixed in a more recent psreadline build.
  • Why is the Terminal resizing though? That's weird. Just maximizing / minimizing the Terminal shouldn't resize the window. It should just swap between the two states. Weird.

@j4james
Copy link
Collaborator

j4james commented Apr 6, 2024

This has been annoying me recently, so I tried to find out what was causing the issue, and it looks to me like it might be the XAML framework that is giving us the wrong size. When I minimize the terminal, I receive a height in the ControlCore::SizeChanged handler that is 8 pixels smaller than what it should be (this translates to 16 device pixels, since my display scaling is 200%).

I don't know if this is something we can fix, but as a workaround, I've discovered that you can prevent it from triggering a scroll just by tweaking the window padding. The idea is to adjust the available height so that the maximized size and minimized size both round down to the same number of rows.

As an example on my system, using device pixels, the original panel height was 1857, which allowed for 50 rows with a 37 pixel cell height. The minimized height was 1841, which only allowed for 49 rows. It was that difference in row count that caused it to scroll up a line.

But after adjusting the padding, I was able to get the base height down to 1846, which results in a minimized height of 1830. Since both of those can fit 49 rows with a 37 pixel cell height, there is no longer a change in row count when minimizing and maximizing, so it doesn't trigger a scroll.

The amount of padding you need to add will obviously depend on your screen size and font size, but if you're desperate enough to fix the issue, you can just keep adjusting the padding 1 pixel at a time until it eventually works (hopefully).

@tusharsnx
Copy link
Contributor

size-change-maximized-minimized

Under Minimized state, we go into Window mode styling that adds extra padding at the top.

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Apr 13, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 16, 2024
Closes: #13961

This PR changes the window styling we use under the minimized state. We
now retain the active window styling so the content's height doesn't
change when switching between minimized and maximized states.

## Validation Steps Performed
- Open Terminal and go into Maximized mode.
- Click on the Minimize button.
- No `SizeChanged` event in `ControlCore`.
- Click on the WT icon in the taskbar to restore it.
- No `SizeChanged` event in `ControlCore`.
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Apr 16, 2024
DHowett pushed a commit that referenced this issue Apr 22, 2024
Closes: #13961

This PR changes the window styling we use under the minimized state. We
now retain the active window styling so the content's height doesn't
change when switching between minimized and maximized states.

## Validation Steps Performed
- Open Terminal and go into Maximized mode.
- Click on the Minimize button.
- No `SizeChanged` event in `ControlCore`.
- Click on the WT icon in the taskbar to restore it.
- No `SizeChanged` event in `ControlCore`.

(cherry picked from commit 11c4aa4)
Service-Card-Id: 92350318
Service-Version: 1.19
DHowett pushed a commit that referenced this issue Apr 22, 2024
Closes: #13961

This PR changes the window styling we use under the minimized state. We
now retain the active window styling so the content's height doesn't
change when switching between minimized and maximized states.

## Validation Steps Performed
- Open Terminal and go into Maximized mode.
- Click on the Minimize button.
- No `SizeChanged` event in `ControlCore`.
- Click on the WT icon in the taskbar to restore it.
- No `SizeChanged` event in `ControlCore`.

(cherry picked from commit 11c4aa4)
Service-Card-Id: 92350319
Service-Version: 1.20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants