-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
Starship multi-line prompt doesn't play nice with resizes #36
Comments
So, the last issue happened because when we line wrap and a line had 0 characters (as temporarily happens before the starship prompt re-renders) there was a situation where we created a CanonicalLine with no WrappedFragments in it (bad!). Each CanonicalLine should always have at least one WrappedFragment. So, I fixed this and now all seems to work fine. There's only one issue left where previously rendered prompts get a little messed up when resizing panes, but similar (and worse) things happen with normal terminal windows, so I'm going to call this a win and leave this for now. :) |
I started working on this issue and then realized it's a little bit of a rabbit hole, so I'm going to update on my progress here.
Initial issue:
I fixed this by properly responding to the 'C' csi dispatch. 'C' is "Cursor forward", using the first parameter as the count to move forward. But like with other dispatches, 0 means 1 (just 0 though, 1 also means 1, and 2 means 2... it's fun like that :) ). So I fixed it to treat 0 as one and then the cursor appeared in the right place.
Then it broke when we opened another pane with a "cursor out of bounds". This was because we didn't properly change the cursor position when wrapping lines if its line was already wrapped (this is how starship operates, it doesn't create a new line but rather a new wrap by filling the first line with spaces). So, I fixed that in our line wrapping methods and we now treat it properly.
Now, it crashes when we resize the pane to a smaller size than the first starship line. I'm debugging this now.
The text was updated successfully, but these errors were encountered: