dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
435 stars 9 forks source link

using pane borderless=true results in zellij crash #20

Closed cosmikwolf closed 9 months ago

cosmikwolf commented 11 months ago

When I use the following layout using kitty terminal, it seems like zellij is trying to add borders, but then the next render it removes it, and this locks up the zellij server and I get the error below

layout {
  pane borderless=true
  pane size=1 borderless=true {
    plugin location="file:~/.local/share/zellij/zjstatus.wasm" {
            format_left  "{mode} #[fg=#89B4FA,bold]{session} {tabs}"
            format_right "{datetime}"
            format_space ""

            border_enabled  "true"
            border_char     "─"
            border_format   "#[fg=#6C7086]{char}"
            border_position "top"

            hide_frame_for_single_pane "true"

            mode_normal  "#[bg=blue] "
            mode_tmux    "#[bg=#ffc387] "

            tab_normal   "#[fg=#6C7086] {name} "
            tab_active   "#[fg=#9399B2,bold,italic] {name} "

            datetime        "#[fg=#6C7086,bold] {format} "
            datetime_format "%A, %d %b %Y %H:%M"
            datetime_timezone "Europe/Berlin"
        }
    }
}
Your zellij client lost connection to the zellij server.

As a safety measure, you have been disconnected from the current zellij session.
However, the session should still exist and none of your data should be lost.

This usually means that your terminal didn't process server messages quick
enough. Maybe your system is currently under high load, or your terminal
isn't performant enough.

There are a few things you can try now:
    - Reattach to your previous session and see if it works out better this
      time: `zellij attach lucky-piano`
    - Try using a faster (maybe GPU-accelerated) terminal emulator

Not sure if this is a zjstatus bug, or a zellij bug. I will submit to both repos. https://github.com/zellij-org/zellij/issues/2901

dj95 commented 11 months ago

Hey,

I've tried to reproduce the issue, but it does not occur on my side. Testing it with your provided layout and the following versions:

Have you already tried to clean the cache? It's located at ~/.cache/zellij under linux and ~/Library/Caches/org.Zellij-Contributors.Zellij/ under macOS.

dj95 commented 11 months ago

Have you also tried to set pane size for zjstatus to 2? When you enable the border (with "border_enabled" true) in zjstatus, the size must be at least 2, since it otherwise won't render properly. This could also cause the issue.

dj95 commented 10 months ago

Hi @cosmikwolf

Do you have any updates on this?

dj95 commented 9 months ago

Hello,

I kindly ask you, if the issue still persist and if you tried the solutions. Otherwise I'll close the issue in a few days, since it is not reproducible and I assume that it's working due to the missing feedback.

ElPapiMango commented 9 months ago

Hi, I got the same issue when using his config. I updated pane size to 2 but same issue.

Windows Terminal Preview, Version: 1.19.3172.0 zellij 0.38.2 zjstatus 0.8.0

dj95 commented 9 months ago

Hi,

have you already tried the latest versions of zellij and zjstatus?

dj95 commented 9 months ago
Screenshot 2023-12-26 at 18 47 16

As mentioned before, I cannot reproduce it. Please try to give as many information as possible and try the latest version + clean the cache from zellij.

ElPapiMango commented 9 months ago

Did you try to crate new pane once loaded? ALT+n?

ElPapiMango commented 9 months ago

I downloaded zjstatus 0.11 and its same there.

dj95 commented 9 months ago

That produces glitchy visuals for me. It jumps back and forth with the pane borders, since zjstatus will not be able to detect whether pane borders are active or not due to the borderless=true on the shell pane. But it does not crash on my side.

Can you try to set hide_frame_for_single_pane to false and test it again, please?

dj95 commented 9 months ago

If you approve, that it works on your side, I could directly release the bugfix, @ElPapiMango .

Found an issue with the border calculation when the first pane is not able to retrieve a border. Thanks for the details! It really helped me!

Screenshot 2023-12-26 at 19 40 20
ElPapiMango commented 9 months ago

Can you try to set hide_frame_for_single_pane to false and test it again, please?

No issues when doing this.👍🏻

dj95 commented 9 months ago

Thanks a lot, @ElPapiMango ! Release 0.11.1 contains the fix.