dj95/zjstatus

Status bar disappears on new tabs

Closed this issue · 8 comments

After some time during a session, the status bar disappears when new tabs are created. This persists even if the session is exited and resurrected. The only fix is to delete the session. Note that the status bar is only invisible in the newly created tab. It still remains visible in old created tabs.

To Reproduce
Steps to reproduce the behavior:

  1. Open a session and use it for a couple of minutes
  2. Open a new tab in said session
  3. No visible status bar

Expected behavior
The status bar to be visible

Screenshots

  1. Tab 1: Visible status bar
    image

  2. Tab 5: Invisible status bar
    image

Desktop (please complete the following information):

  • OS: Arch Linux x86_64
  • Zellij version v0.40.1
  • Version v0.16.1-rc1

Layout

How does the layout look like? Please copy it into a code block.

layout {
  tab {
    pane borderless=true split_direction="vertical"
  }

  default_tab_template {
    children
    pane size=1 borderless=true {
      plugin location="zjstatusbar" {

        format_left   "{mode}#[bg=#181926] {tabs}"
        format_center ""
        format_right  "#[bg=#181926,fg=#89b4fa]#[bg=#89b4fa,fg=#1e2030,bold] #[bg=#363a4f,fg=#89b4fa,bold] {session} #[bg=#181926,fg=#363a4f,bold]"
        format_space  "#[bg=#181926]"
        format_hide_on_overlength "true"
        format_precedence "crl"

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

        mode_normal        "#[bg=#89b4fa,fg=#181926,bold] NORMAL#[bg=#181926,fg=#89b4fa]█"
        mode_locked        "#[bg=#6e738d,fg=#181926,bold] LOCKED #[bg=#181926,fg=#6e738d]█"
        mode_resize        "#[bg=#f38ba8,fg=#181926,bold] RESIZE#[bg=#181926,fg=#f38ba8]█"
        mode_pane          "#[bg=#89b4fa,fg=#181926,bold] PANE#[bg=#181926,fg=#89b4fa]█"
        mode_tab           "#[bg=#b4befe,fg=#181926,bold] TAB#[bg=#181926,fg=#b4befe]█"
        mode_scroll        "#[bg=#f9e2af,fg=#181926,bold] SCROLL#[bg=#181926,fg=#f9e2af]█"
        mode_enter_search  "#[bg=#a6da95,fg=#181926,bold] ENT-SEARCH#[bg=#181926,fg=#a6da95]█"
        mode_search        "#[bg=#8aadf4,fg=#181926,bold] SEARCHARCH#[bg=#181926,fg=#8aadf4]█"
        mode_rename_tab    "#[bg=#b4befe,fg=#181926,bold] RENAME-TAB#[bg=#181926,fg=#b4befe]█"
        mode_rename_pane   "#[bg=#89b4fa,fg=#181926,bold] RENAME-PANE#[bg=#181926,fg=#89b4fa]█"
        mode_session       "#[bg=#74c7ec,fg=#181926,bold] SESSION#[bg=#181926,fg=#74c7ec]█"
        mode_move          "#[bg=#f5c2e7,fg=#181926,bold] MOVE#[bg=#181926,fg=#f5c2e7]█"
        mode_prompt        "#[bg=#8aadf4,fg=#181926,bold] PROMPT#[bg=#181926,fg=#8aadf4]█"
        mode_tmux          "#[bg=#f5a97f,fg=#181926,bold] TMUX#[bg=#181926,fg=#f5a97f]█"

        // formatting for inactive tabs
        tab_normal              "#[bg=#181926,fg=#89b4fa]█#[bg=#89b4fa,fg=#1e2030,bold]{index} #[bg=#363a4f,fg=#89b4fa,bold] {name}{floating_indicator}#[bg=#181926,fg=#363a4f,bold]█"
        tab_normal_fullscreen   "#[bg=#181926,fg=#89b4fa]█#[bg=#89b4fa,fg=#1e2030,bold]{index} #[bg=#363a4f,fg=#89b4fa,bold] {name}{fullscreen_indicator}#[bg=#181926,fg=#363a4f,bold]█"
        tab_normal_sync         "#[bg=#181926,fg=#89b4fa]█#[bg=#89b4fa,fg=#1e2030,bold]{index} #[bg=#363a4f,fg=#89b4fa,bold] {name}{sync_indicator}#[bg=#181926,fg=#363a4f,bold]█"

        // formatting for the current active tab
        tab_active              "#[bg=#181926,fg=#fab387]█#[bg=#fab387,fg=#1e2030,bold]{index} #[bg=#363a4f,fg=#fab387,bold] {name}{floating_indicator}#[bg=#181926,fg=#363a4f,bold]█"
        tab_active_fullscreen   "#[bg=#181926,fg=#fab387]█#[bg=#fab387,fg=#1e2030,bold]{index} #[bg=#363a4f,fg=#fab387,bold] {name}{fullscreen_indicator}#[bg=#181926,fg=#363a4f,bold]█"
        tab_active_sync         "#[bg=#181926,fg=#fab387]█#[bg=#fab387,fg=#1e2030,bold]{index} #[bg=#363a4f,fg=#fab387,bold] {name}{sync_indicator}#[bg=#181926,fg=#363a4f,bold]█"

        // separator between the tabs
        tab_separator           "#[bg=#181926] "

        // indicators
        tab_sync_indicator       " "
        tab_fullscreen_indicator " 󰊓"
        tab_floating_indicator   " 󰹙"

        command_git_branch_command     "git rev-parse --abbrev-ref HEAD"
        command_git_branch_format      "#[fg=blue] {stdout} "
        command_git_branch_interval    "10"
        command_git_branch_rendermode  "static"

        datetime        "#[fg=#6C7086,bold] {format} "
        datetime_format "%A, %d %b %Y %H:%M"
        datetime_timezone "Africa/Lagos"


      }
    }
  }

Additional context
If I edit my zellij config.kdl while a session is in use, I believe it triggers the issue instantaneously also. I'm not too sure about this so take with a grain of salt.

dj95 commented

Hi and thanks for the bug report. Can you test this with the latest release, please?

Ohh, I didn't know there was a new release. Lemme give it a whirl then

I just tried the latest release and the issue is still apparent. I also deleted zellij cache just to be sure.

dj95 commented

How is zjstatus configured in your config.kdl? I suspect that it is bugging around with the plugin alias and the configuration in your layout.

I'm using an alias

config.kdl

plugins {
    tab-bar location="zellij:tab-bar"
    status-bar location="zellij:status-bar"
    strider location="zellij:strider" {
    }
    compact-bar location="zellij:compact-bar"
    session-manager location="zellij:session-manager"
    welcome-screen location="zellij:session-manager" {
        welcome_screen true
    }
    filepicker location="zellij:strider" {
        cwd "/"
    }
    monocle location="file:~/.config/zellij/plugins/monocle"
    zjstatusbar location="file:~/.config/zellij/plugins/zjstatus.wasm"
}
dj95 commented

Unfortunately, I cannot reproduce the error. Spun up an arch linux docker container and tried to replicate the setup. The only thing that I changed was a missing } in your layout.

Does the log file contain anything relevant? Since zellij does not even renders the line reserved for zjstatus, I'd guess that it is an issue within zellij loading/applying the layout.

AFAIK zellij is not really made for editing its config file while one session is running. I'd suggest to finish editing and afterwards start the session. You could also try to clean the cache in case of plugin problems. I'm also not sure, how the configuration and layout is baked into serialised sessions. Personally, I do not use them because there are too many things that could break in case of serialisation (especially with environment variables etc.). But this could also explain your issues.


Edit: My last comment made me think about session serialisation and resurrection. It's exactly what causes the issue.

[root@faeb2c185ebf circular-ukulele]# cat session-layout.kdl
layout {
    cwd "/app"
    tab name="Tab #1" focus=true hide_floating_panes=true {
        pane focus=true
        pane size=1 borderless=true {
            plugin location="file:/root/.config/zellij/plugins/zjstatus.wasm" {
            border_char "─"
            border_enabled "false"
            border_format "#[fg=#6C7086]{char}"
            border_position "top"

As you can see, the tab is only serialised, but not the default_tab_template. Therefore it won't be loaded on newly created tabs.

Since this is zellijs behaviour and I cannot really do much about it, I'd kindly ask you to open an issue on their side. This issue however sounds really similar: zellij-org/zellij#3117

dj95 commented

For a quick mitigation, saving the plugin configuration into the plugin alias in your config.kdl instead of the default.kdl seems to work.

As it is otherwise a zellij issue and I've created an issue there, I'll close this issue.

Please let me know, if the mitigation worked for you :)

After 24 hours of usage, I can confirm the quick fix is working. Thank you