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

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

Open
jessey-git opened this issue Oct 1, 2023 · 18 comments
Open
Assignees
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.

Comments

@jessey-git
Copy link

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.

@jessey-git jessey-git added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 1, 2023
@zadjii-msft
Copy link
Member

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 zadjii-msft added Product-Conhost For issues in the Console codebase Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Product-Terminal The new Windows Terminal. labels Oct 2, 2023
@zadjii-msft zadjii-msft added this to the Terminal v1.20 milestone Oct 2, 2023
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 4, 2023
@bslote
Copy link

bslote commented 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.

@jessey-git
Copy link
Author

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

@jessey-git
Copy link
Author

Still broken on Terminal 1.20.10293.0

@jessey-git
Copy link
Author

@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?

@DHowett
Copy link
Member

DHowett commented 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.

@jessey-git
Copy link
Author

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

@Willovent
Copy link

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.

@jessey-git
Copy link
Author

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"
    },

@thomaslevesque
Copy link

@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?

@jessey-git
Copy link
Author

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.

@zadjii-msft
Copy link
Member

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

@JanDeDobbeleer
Copy link

@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.

@Willovent
Copy link

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

@jessey-git
Copy link
Author

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.

@JanDeDobbeleer
Copy link

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.

@zadjii-msft
Copy link
Member

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

@sba923
Copy link

sba923 commented May 8, 2024

Problem still present in Preview v1.21.1272.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

10 participants