dj95 / zjstatus

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

New session no loading plugin #32

Closed casonadams closed 2 months ago

casonadams commented 5 months ago

Describe the bug zjstatus isn't being loaded when creating a new session via session-manager

To Reproduce Steps to reproduce the behavior:

  1. Active session-manager
  2. Create new session (ctrl + w)

Expected behavior A new session created loading zjstatus

Actual behavior A new session loading default plugin zellij:tab-bar

Desktop (please complete the following information):

Layout

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

// vi: ft=javascript

layout {
  pane
  pane size=1 borderless=true {
        // curl -L -o $HOME/.config/zellij/plugins/zjstatus.wasm https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm
    plugin location="file:$HOME/.config/zellij/plugins/zjstatus.wasm" {
      hide_frame_for_single_pane "false"

      format_left  "#[fg=0,bg=10] [{session}] {tabs}"
      format_space "#[bg=10]"
      format_right "#[fg=0,bg=10]{command_git_branch} {datetime}"

      tab_normal "{name}  "
      tab_active "{name}* "

      command_git_branch_command    "git rev-parse --abbrev-ref HEAD"
      command_git_branch_format     "{stdout} "
      command_git_branch_interval   "10"
      command_git_branch_rendermode "static"

      datetime                  " {format} "
      datetime_format     "%H:%M:%S"
      datetime_timezone "America/Denver"
    }
  }
}
session_name "0"
attach_to_session true

Additional context This might be an issue with zellij proper and not this plugin 🤷

dj95 commented 5 months ago

Hey,

thanks for your bug report. Can you please check how you created the layout and configured it? Especially check if it is configured as default layout, please. On my side it seems to work.

https://github.com/dj95/zjstatus/assets/4348959/ca70ba3a-c4a0-421b-a18f-6433a05a8ed2

casonadams commented 5 months ago
default_layout "basic"
.config/zellij
├── config.kdl
├── layouts
│   └── basic.kdl
├── plugins
│   └── zjstatus.wasm
└── themes
    └── default.kdl

I am not sure if this is what you mean.

dj95 commented 5 months ago

Exactly these information, I were looking for :)

Is basic.kdl the layout you've provided with zjstatus config?

On my machine, I stored the layout config in a file called default.kdl in the layout directory. This way you don't need to set the default_layout config key. Can you test if this works?

dj95 commented 5 months ago

Did you have another try with the default.kdl as filename?

casonadams commented 5 months ago

yes I get the same results.

├── config.kdl
├── layouts
│   └── default.kdl
├── plugins
│   └── zjstatus.wasm
└── themes
    └── default.kdl
casonadams commented 5 months ago

https://github.com/dj95/zjstatus/assets/17597548/7361b0e8-9d9d-44d1-9d58-4df6ed2ea19d

dj95 commented 4 months ago

Sorry for the late reply. Did you manage to solve the problem?

I've tried to recreate it again within a docker container and your exact same versions. Still no luck in recreating the issue.

Screenshot 2024-03-01 at 18 36 43

Here are all of the config I've created, so you are able to verify if there is something different from your setup (except the OS).

config.kdl

default_layout "basic"

basic.kdl

// vi: ft=javascript

layout {
  pane
  pane size=1 borderless=true {
        // curl -L -o $HOME/.config/zellij/plugins/zjstatus.wasm https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm
    plugin location="file:$HOME/.config/zellij/plugins/zjstatus.wasm" {
      hide_frame_for_single_pane "false"

      format_left  "#[fg=0,bg=10] [{session}] {tabs}"
      format_space "#[bg=10]"
      format_right "#[fg=0,bg=10]{command_git_branch} {datetime}"

      tab_normal "{name}  "
      tab_active "{name}* "

      command_git_branch_command    "git rev-parse --abbrev-ref HEAD"
      command_git_branch_format     "{stdout} "
      command_git_branch_interval   "10"
      command_git_branch_rendermode "static"

      datetime                  " {format} "
      datetime_format     "%H:%M:%S"
      datetime_timezone "America/Denver"
    }
  }
}
session_name "0"
attach_to_session true

https://github.com/dj95/zjstatus/assets/4348959/9a5c400e-a567-4b7e-8759-cdc420ed4f03


The only thing I could image is, that other another zellij instance is running without the configuration or the cache is somehow messed up. You could try to clean the cache at ~/Library/Caches/org.Zellij-Contributors.Zellij/* and reboot your Mac. Otherwise I'm pretty desperate and have no idea what is going on. Sorry.

dj95 commented 3 months ago

Hey @casonadams , any updates on this?

casonadams commented 3 months ago

No I don't have an update. I suppose if you can't reproduce it's just an error on my side.

We can probably just close this out then yes?

dj95 commented 3 months ago

I'm sorry for your experience. Maybe you can also test, if the remaining layout besides zjstatus also is not loaded and then open an issue on zellijs side. It might be an issue on this end.

dj95 commented 2 months ago

Feel free to re-open or comment the issue, if you found a minimal reproduction scenario (best in a docker container). Then I'll take a look at it.