Resizing terminal window destroys both powerline formatting and text layout #20597

Closed
opened 2026-01-31 07:18:40 +00:00 by claunia · 22 comments
Owner

Originally created by @jessey-git on GitHub (Oct 1, 2023).

Originally assigned to: @DHowett on GitHub.

Windows Terminal version

1.19.2682.0

Windows build number

10.0.22621.0

Other Software

Oh My Posh [JanDeDobbeleer.OhMyPosh] Version: 18.10.3

Steps to reproduce

Here's 2 situations, see screenshots for examples as well.

Example 1

  • Start with a working powerline prompt like what you get with "oh-my-posh" [1]
  • Maximize the terminal window - see the fonts and formatting break [2]
  • Unmaximize and see the brokenness still [3]

Example 2

  • Start with a maximized window and execute a long command that will scroll the screen. Like cat a long file.
  • Minimize the window -- notice that the cursor is in the wrong spot and layout is hosed (the gci command) [4]

[1] 1
[2] 2
[3] 3
[4] 4

Expected Behavior

While it 'tis the season... expected behavior is for nothing spooky to happen! Look at those poor powerline fonts reduced to their skeletons! And what is my text doing in the wrong spots faints

Actual Behavior

See repro steps.

Originally created by @jessey-git on GitHub (Oct 1, 2023). Originally assigned to: @DHowett on GitHub. ### Windows Terminal version 1.19.2682.0 ### Windows build number 10.0.22621.0 ### Other Software Oh My Posh [JanDeDobbeleer.OhMyPosh] Version: 18.10.3 ### Steps to reproduce Here's 2 situations, see screenshots for examples as well. Example 1 - Start with a working powerline prompt like what you get with "oh-my-posh" [1] - Maximize the terminal window - see the fonts and formatting break [2] - Unmaximize and see the brokenness still [3] Example 2 - Start with a maximized window and execute a long command that will scroll the screen. Like `cat` a long file. - Minimize the window -- notice that the cursor is in the wrong spot and layout is hosed (the gci command) [4] [1] ![1](https://github.com/microsoft/terminal/assets/7989986/1e8b4a08-c642-41f0-af5c-336b5c2fb573) [2] ![2](https://github.com/microsoft/terminal/assets/7989986/fa5bbcf5-42e8-4807-ab02-6b8cdf951f37) [3] ![3](https://github.com/microsoft/terminal/assets/7989986/c59fa097-8e59-43ef-bc8e-3a1c78537d37) [4] ![4](https://github.com/microsoft/terminal/assets/7989986/bb5ebe12-8814-44bd-8fb2-894b25eb24db) ### Expected Behavior While it 'tis the season... expected behavior is for nothing spooky to happen! Look at those poor powerline fonts reduced to their skeletons! And what is my text doing in the wrong spots *faints* ### Actual Behavior See repro steps.
Author
Owner

@zadjii-msft commented on GitHub (Oct 2, 2023):

HMM this seems a little bit like the "the colors on my prompt disappeared" thing that @DHowett saw in the bug bash last week, and a little bit like the scrolling thing that was noted in #16034. I don't know for sure if they're the same thing.

I'll tag this up for 1.19 servicing. We'll try and use these notes to get a solid repro and make sure that it all gets cleaned up. Thanks!

@zadjii-msft commented on GitHub (Oct 2, 2023): HMM this seems a little bit like the "the colors on my prompt disappeared" thing that @DHowett saw in the bug bash last week, and a little bit like the scrolling thing that was noted in #16034. I don't know for sure if they're the same thing. I'll tag this up for 1.19 servicing. We'll try and use these notes to get a solid repro and make sure that it all gets cleaned up. Thanks!
Author
Owner

@bslote commented on GitHub (Nov 2, 2023):

FWIW this doesn't happen with older versions of oh-my-posh. I have 2 machines with identical configurations except for omp version:

Machine A)

  • Terminal 1.19.2682.0
  • omp 12.28.2

Machine B)

  • Terminal 1.19.2682.0
  • omp 18.22.0

This problem only occurs on machine B, so I wonder if this might actually be a bug with omp, but if it isn't then it should be possible to bisect whatever changed in omp that is causing the issue in Terminal.

@bslote commented on GitHub (Nov 2, 2023): FWIW this doesn't happen with older versions of oh-my-posh. I have 2 machines with identical configurations except for omp version: Machine A) - Terminal 1.19.2682.0 - omp 12.28.2 Machine B) - Terminal 1.19.2682.0 - omp 18.22.0 This problem only occurs on machine B, so I wonder if this might actually be a bug with omp, but if it isn't then it should be possible to bisect whatever changed in omp that is causing the issue in Terminal.
Author
Owner

@jessey-git commented on GitHub (Nov 2, 2023):

It's not occurring with Terminal 1.18.2822.0 so my bet is still on something primarily with Terminal.

@jessey-git commented on GitHub (Nov 2, 2023): It's not occurring with Terminal 1.18.2822.0 so my bet is still on something primarily with Terminal.
Author
Owner

@jessey-git commented on GitHub (Jan 31, 2024):

Still broken on Terminal 1.20.10293.0

@jessey-git commented on GitHub (Jan 31, 2024): Still broken on Terminal 1.20.10293.0
Author
Owner

@jessey-git commented on GitHub (Jan 31, 2024):

@zadjii-msft @DHowett With the other issue mentioned above having been closed but v1.20 still showing this issue for me, is it possible to take another look now?

@jessey-git commented on GitHub (Jan 31, 2024): @zadjii-msft @DHowett With the other issue mentioned above having been closed but v1.20 still showing this issue for me, is it possible to take another look now?
Author
Owner

@DHowett commented on GitHub (Feb 1, 2024):

Absolutely. Thanks! This bites me on the regular as well, but if I could nail down some repro steps I'd love it.

@DHowett commented on GitHub (Feb 1, 2024): Absolutely. Thanks! This bites me on the regular as well, but if I could nail down some repro steps I'd _love_ it.
Author
Owner

@jessey-git commented on GitHub (Feb 1, 2024):

Hmm, don't the repro steps up above hit the problem for you? Both examples are still 100% repro for me here.

@jessey-git commented on GitHub (Feb 1, 2024): Hmm, don't the repro steps up above hit the problem for you? Both examples are still 100% repro for me here.
Author
Owner

@Willovent commented on GitHub (Mar 15, 2024):

I'm facing this issue right now trying some new configs. I reproduce this as soon as I use one rprompt block. If I change it to prompt, everything works fine.

@Willovent commented on GitHub (Mar 15, 2024): I'm facing this issue right now trying some new configs. I reproduce this as soon as I use one `rprompt` block. If I change it to `prompt`, everything works fine.
Author
Owner

@jessey-git commented on GitHub (Mar 16, 2024):

Good find! The usage of a rprompt does seem related to both of my cases above. Though, in my case at least, using the regular "type": "prompt" field but keeping "alignment": "right" also yields odd rendering for my two scenarios as well.

Here's a full configuration block to play with:

    {
      "alignment": "right",
      "segments": [
        {
          "background": "#306090",
          "foreground": "#ffffff",
          "leading_diamond": "\ue0b2",
          "style": "diamond",
          "template": " meow ",
          "type": "text"
        }
      ],
      "type": "rprompt"
    },
@jessey-git commented on GitHub (Mar 16, 2024): Good find! The usage of a `rprompt` does seem related to both of my cases above. Though, in my case at least, using the regular `"type": "prompt"` field but keeping `"alignment": "right"` also yields odd rendering for my two scenarios as well. Here's a full configuration block to play with: ``` { "alignment": "right", "segments": [ { "background": "#306090", "foreground": "#ffffff", "leading_diamond": "\ue0b2", "style": "diamond", "template": " meow ", "type": "text" } ], "type": "rprompt" }, ```
Author
Owner

@thomaslevesque commented on GitHub (Mar 25, 2024):

@jessey-git your workaround seems to work for me, thanks!
So it might be a bug in OMP... Do you know if there's already an open issue in OMP that I can subscribe to?

@thomaslevesque commented on GitHub (Mar 25, 2024): @jessey-git your workaround seems to work for me, thanks! So it might be a bug in OMP... Do you know if there's already an open issue in OMP that I can subscribe to?
Author
Owner

@jessey-git commented on GitHub (Mar 25, 2024):

No, I filed the bug here because I noticed it back during the transition from Terminal 1.18 to 1.19. At that time the same version of OMP worked completely fine in 1.18 but failed in 1.19 so I took that as indication it was a Terminal bug.

@jessey-git commented on GitHub (Mar 25, 2024): No, I filed the bug here because I noticed it back during the transition from Terminal 1.18 to 1.19. At that time the same version of OMP worked completely fine in 1.18 but failed in 1.19 so I took that as indication it was a Terminal bug.
Author
Owner

@zadjii-msft commented on GitHub (Mar 28, 2024):

quick question before I dig in more - @jandedobbeleer this look familiar?

@zadjii-msft commented on GitHub (Mar 28, 2024): quick question before I dig in more - @jandedobbeleer this look familiar?
Author
Owner

@JanDeDobbeleer commented on GitHub (Mar 28, 2024):

@zadjii-msft I wonder what version of oh-my-posh is being used here and if this is still reproducible using the latest. rprompt used ANSI sequences to position the cursor all the way to the right, then move the cursor back based on the length of the right aligned block or prompt. However, lately I moved that to spaces instead, so that logic is gone. Would be cool if we could validate that.

@JanDeDobbeleer commented on GitHub (Mar 28, 2024): @zadjii-msft I wonder what version of oh-my-posh is being used here and if this is still reproducible using the latest. `rprompt` used ANSI sequences to position the cursor all the way to the right, then move the cursor back based on the length of the right aligned block or prompt. However, lately I moved that to spaces instead, so that logic is gone. Would be cool if we could validate that.
Author
Owner

@Willovent commented on GitHub (Mar 28, 2024):

I'm using oh-my-posh 19.18.1 and still reproducing right now

@Willovent commented on GitHub (Mar 28, 2024): I'm using oh-my-posh 19.18.1 and still reproducing right now
Author
Owner

@jessey-git commented on GitHub (Mar 29, 2024):

Same 19.18.1 version of OMP here right now and still reproduces. The version that I was using at the time of initial filing is still in original message too in case that's helpful.

@jessey-git commented on GitHub (Mar 29, 2024): Same 19.18.1 version of OMP here right now and still reproduces. The version that I was using at the time of initial filing is still in original message too in case that's helpful.
Author
Owner

@JanDeDobbeleer commented on GitHub (Mar 29, 2024):

In that case I have no idea. rprompt uses ANSI to store and restore the cursor position, but a right aligned block only uses spaces so there's nothing that could influence coloring in a way.

@JanDeDobbeleer commented on GitHub (Mar 29, 2024): In that case I have no idea. `rprompt` uses ANSI to store and restore the cursor position, but a right aligned block only uses spaces so there's nothing that could influence coloring in a way.
Author
Owner

@zadjii-msft commented on GitHub (Mar 29, 2024):

Well, thanks for the quick look at least! I'll try and get a local repro setup

@zadjii-msft commented on GitHub (Mar 29, 2024): Well, thanks for the quick look at least! I'll try and get a local repro setup
Author
Owner

@sba923 commented on GitHub (May 8, 2024):

Problem still present in Preview v1.21.1272.0

@sba923 commented on GitHub (May 8, 2024): Problem still present in Preview v1.21.1272.0
Author
Owner

@sba923 commented on GitHub (Jul 1, 2024):

Problem still present in Preview v1.21.1772.0

@sba923 commented on GitHub (Jul 1, 2024): Problem still present in Preview v1.21.1772.0
Author
Owner

@DHowett commented on GitHub (Jul 15, 2024):

This turned out to be a fun one! Assigning myself, PR to follow.

@DHowett commented on GitHub (Jul 15, 2024): This turned out to be a fun one! Assigning myself, PR to follow.
Author
Owner

@DHowett commented on GitHub (Aug 9, 2024):

Huh, we never linked this up to the PR that fixed it.

@DHowett commented on GitHub (Aug 9, 2024): Huh, we never linked this up to the PR that fixed it.
Author
Owner

@DHowett commented on GitHub (Aug 9, 2024):

Fixed in #17568, currently available in Canary, will be backported to 1.21 before it goes out as Stable; we may also choose to service 1.20 stable.

Funny enough, if your prompt was on a line number that was evenly divisible by 128 when you resized, you would not have experienced this bug (!)

@DHowett commented on GitHub (Aug 9, 2024): Fixed in #17568, currently available in Canary, will be backported to 1.21 before it goes out as Stable; we may also choose to service 1.20 stable. Funny enough, if your prompt was on a line number that was evenly divisible by 128 when you resized, you would not have experienced this bug (!)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20597