zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.47k stars 637 forks source link

Resizing panes leads to prompt text glitches #321

Closed surge9n closed 2 years ago

surge9n commented 3 years ago

Steps:

  1. Open a 4-pane layout via M-n
  2. Close the upper-right pane via C-p x
  3. Resize either of the lower panes via C-p r [hjkl]+

Result: Starship prompt is being smeared all over the lower half in both panels, cf. screenshot.

2021-04-22-171718_3840x1080_scrot

syncore commented 3 years ago

2021-04-22_21-13

qballer commented 3 years ago

I can confirm this happens to me as well using the fish shell alacritty combo

samebchase commented 3 years ago

In general, resizing does not work as expected for me. zsh, alacritty on Mac. I would expect that the text gets reflowed in a predictable fashion.

imsnif commented 3 years ago

@samebchase - could you please share a little bit more what you mean?

scabala commented 3 years ago

Hi, I've encountered the same problem. zellij version: 0.16.0 (latest) OS: Fedora 33 Terminal emulator: Terminator/Alacritty Shell: Bash/ZSH/Fish Additional info: using Starship prompt. But this also happens when not using it. However (it might be very subjective) not using Starship prompt makes it somewhat less buggy. It only happens when resizing horizontally (left-right).

I really would like to try zellij but this is a deal breaker for me. How can I help with debugging this issue?

imsnif commented 3 years ago

@scabala - could you describe the problem in detail? Maybe attach an animated gif of what happens when you resize a pane inside Zellij and the same thing when you resize the terminal window outside of Zellij?

a-kenji commented 3 years ago

@imsnif This is an example with alacritty, fish, starship, zellij. zellij-resize This is an example with kitty, fish, starship, zellij: kitty-zellij-rezise The smearing on the free resize here is not an issue, I think this has to to with the low framerate of the gif and the fact that I don't use a compositor.

scabala commented 3 years ago

@imsnif, the behavior presented in GIFs by @a-kenji is what I experience when resizing.

It would understandable when prompt is messy when I resize pane in such a way it does not have enough place to print prompt but it happens even earlier, as presented by GIFs.

imsnif commented 3 years ago

@a-kenji, @scabala - I've been trying for the past hour and for the life of me I cannot reproduce this issue with fish/starship or with bash/starship (I don't think the terminal emulator is relevant here). This might have to do with a particular fish/starship configuration.

I have a guess about why this is happening, but it would be very hard for me to debug this blindly. If any of you wants to work on this I'd be happy to provide guidance.

a-kenji commented 3 years ago

@imsnif, I would be interested at taking a closer look at that.

scabala commented 3 years ago

@imsnif I am interested in helping to debug it as well.

EDIT: this bug happens also with plain bash shell and in xfce4-terminal/mate-terminal

imsnif commented 3 years ago

@scabala - is it the same bug? where the prompt doubles itself? Because if that's the case my theory was wrong.

scabala commented 3 years ago

@imsnif after some investigation I think it might be different issue, see attached GIF. It's like second prompt appears after resizing (in plus) the pane. My feeling is that is either very esoteric configuration issue or non-deterministic behavior of zellij/shell/terminal. test

imsnif commented 3 years ago

@a-kenji @scabala - I think I found the issue(s). I made a branch here with the fix to make sure. The branch is called wrap-fix. Could you check it out and see if it solves the issue for you?

Please note that there are some Starship issues with extreme low-width resizes. So if you have issues with this branch, please make sure they don't also happen outside of Zellij when resizing.

a-kenji commented 3 years ago

@imsnif Thank you this is much much better! I see this issue as fixed for the time being, I don't know if the intermediate characters can still be hidden (probably not) but the panes are now good on vertical resizes.

On horizontal resizes I still see some issue, but I am not sure it is the same one?

imsnif commented 3 years ago

@a-kenji - how about now?

The minimum size is a regression. I'm not sure when this happened, but we definitely need to fix it. Different issue though :)

a-kenji commented 3 years ago

@imsnif This is awesome, it works well. Cheers. zellij-resize

wiraki commented 2 months ago

Hello, sorry for digging up this old issue. Let me know if you'd rather I open a new one. I have a similar problem with prompt overflowing and re-drawing. Here is a video:

https://github.com/zellij-org/zellij/assets/11855154/cfdf1338-f182-47eb-b853-3419088e4310

I get also problems and artifacts with the content of the pane. Notice how space is increased between output of the last command and command prompt with each decrease-increase cycle. There are also some artifacts of the prompt left over here and there in the pane:

https://github.com/zellij-org/zellij/assets/11855154/907b9df3-2f8a-426b-8ac5-b1e5ffa2a5cd

More info:

❯ zellij --version
zellij 0.40.1
❯ zellij setup --check
[Version]: "0.40.1"
[CONFIG DIR]: "/home/marc/.config/zellij"
[LOOKING FOR CONFIG FILE FROM]: "/home/marc/.config/zellij/config.kdl"
[CONFIG FILE]: Well defined.
[DATA DIR]: "/home/marc/.local/share/zellij"
[PLUGIN DIR]: "/home/marc/.local/share/zellij/plugins"
 Builtin, default plugins will not be loaded from disk.
 Create a custom layout if you require this behavior.
[LAYOUT DIR]: "/home/marc/.config/zellij/layouts"
[SYSTEM DATA DIR]: "/usr/share/zellij"
[ARROW SEPARATOR]: 
 Is the [ARROW_SEPARATOR] displayed correctly?
 If not you may want to either start zellij with a compatible mode: 'zellij options --simplified-ui true'
 Or check the font that is in use:
 https://zellij.dev/documentation/compatibility.html#the-status-bar-fonts-dont-render-correctly
[MOUSE INTERACTION]: 
 Can be temporarily disabled through pressing the [SHIFT] key.
 If that doesn't fix any issues consider to disable the mouse handling of zellij: 'zellij options --disable-mouse-mode'
[DEFAULT EDITOR]: nvim -u ~/.config/nvim-kick/init.lua
[FEATURES]: []
[DOCUMENTATION]: zellij.dev/documentation

System:

image