dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
358 stars 6 forks source link

Mode at startup is not correct #55

Closed FuriouZz closed 1 month ago

FuriouZz commented 1 month ago

Describe the bug The current mode at startup is not correct.

To Reproduce Steps to reproduce the behavior:

  1. Set default_mode "locked" in your configuration
  2. Run zellij with your configuration
  3. Check the mode in the statusbar

Expected behavior The mode in the status bar must be LCK

Screenshots CleanShot 2024-05-06 at 17 57 28

Desktop (please complete the following information):

Layout

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

layout {
    tab name="editor" focus=true hide_floating_panes=true {
        pane name="editor" borderless=true {
            command "hx"
        }
    }

    default_tab_template {
        children
        floating_panes {
            pane { 
                // plugin location="zjpane"
            }
        }
        pane size=1 borderless=true {
            plugin location="zjstatus"
        }
        pane size=1 borderless=true {
            plugin location="status-bar"
        }
    }
}
// config.kdl
plugins {
    zjstatus location="file:~/.config/zellij/plugins/zjstatus.wasm" {
        format_left  "{mode}{tabs}"
        format_right "#[fg=#b8bb26,bold]{swap_layout} #[fg=#83a598,bold]{command_git_branch}"

        hide_frame_for_single_pane "true"

        mode_normal  "#[fg=#292C33,bg=blue,bold] NOR "
        mode_locked  "#[fg=#292C33,bg=green,bold] LCK "
        mode_resize  "#[fg=#292C33,bg=red,bold] RSZ "
        mode_pane    "#[fg=#292C33,bg=magenta,bold] PNE "
        mode_tab     "#[fg=#292C33,bg=magenta,bold] TAB "
        mode_scroll  "#[fg=#292C33,bg=yellow,bold] SCR "
        mode_session "#[fg=#292C33,bg=yellow,bold] SSN "
        mode_move    "#[fg=#292C33,bg=red,bold] MOV "
        mode_tmux    "#[fg=#292C33,bg=green,bold] TMX "

        tab_normal "#[fg=blue] {name}"
        tab_active "#[fg=blue,bold] {name}*"

        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          " {format} "
        datetime_format   "%H:%M %d-%b-%y"
        datetime_timezone "Europe/Berlin"
    }
}

default_mode "locked"

Additional context Add any other context about the problem here.

dj95 commented 1 month ago

Hi and thanks a lot for the detailed bug description!

Can you test, if it occurs also with the 0.14.1-rc1, please? I made some fixes according to processing events on startup, which might resolve this issue.

You'll be able to find the release here: https://github.com/dj95/zjstatus/releases/tag/v0.14.1-rc1

FuriouZz commented 1 month ago

Nice! It seems to work well on 0.14.1-rc1

dj95 commented 1 month ago

Thanks for the confirmation. I released 0.14.1 right now, as the impact of the bug seems to be quite annoying.