zellij-org / zellij

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

loading plugin initially from url fails on complex layouts #3352

Open zombiehoffa opened 4 months ago

zombiehoffa commented 4 months ago

1. Graphical issue inside a terminal pane (eg. something does not look as it should)

  1. Delete the contents of /tmp/zellij-1000/zellij-log, ie with cd /tmp/zellij-1000/ and rm -fr zellij-log/ (/tmp/ is $TMPDIR/ on OSX)
  2. Run zellij --debug
  3. Run stty size, copy the result and attach it in the bug report
  4. Recreate your issue.
  5. Quit Zellij immediately with ctrl-q (your bug should ideally still be visible on screen)

Please attach the files that were created in /tmp/zellij-1000/zellij-log/ to the extent you are comfortable with.

Basic information

zellij --version: 0.40.1 stty size:

uname -av or ver(Windows):

Further information

Reproduction steps, noticeable behavior, related issues, etc create a complex layout with atleast 10 panes set default layout with a plugin loading from a url (my problem is with zjstatus) sgtart zellij and watch it fail, likely timing out.

Switch to simple profile with one tab and the same default layout and delete the cache and tmp files then start zellij again, the plugin loads fine. Stop zellij, swap the simple layout for the complex layout and start zellij again and the complex layout will load with zjstatus in all the right spots.

I think this is possibly trying to build the plugin for each tab and timing out but once it's already built due to the simple layout load it can copy the plugin over just fine.

2. Issues with the Zellij UI / behavior / crash

Issue description

Minimal reproduction

Other relevant information

imsnif commented 4 months ago

Thanks for reporting this, but as stipulated in the issue template, I'm going to need a concrete minimal reproduction (eg. provide a specific layout in which this fails). If we work with abstract concepts such as "a complex layout" we'll likely end up with a game of "can't reproduce" telephone.

Thanks.

zombiehoffa commented 4 months ago

ok, here's the one that doesn't work with the ips, usernames, etc change:

layout { cwd "/home/chris" tab name="btop" hide_floating_panes=true { pane command="btop" cwd="/home/chris" { start_suspended false } } tab name="amdcluster" hide_floating_panes=true { pane split_direction="vertical" { pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } } } tab name="intelcluster" hide_floating_panes=true { pane split_direction="vertical" { pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } } } tab name="tnaspbs" hide_floating_panes=true { pane split_direction="vertical" { pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } } } tab name="vps/vms" hide_floating_panes=true { pane split_direction="vertical" { pane split_direction="horizontal" { pane command="ssh" cwd="~/" { args "-p" "22" "-l" "root" "8.8.8.8" start_suspended true } pane command="ssh" cwd="~/" { args "-l" "root" "8.8.8.8" start_suspended true } } pane split_direction="horizontal" { pane pane } } } tab name="fortivpn" hide_floating_panes=true { pane } tab name="zsh" hide_floating_panes=true { pane split_direction="vertical" { pane pane } } tab name="zsh1" hide_floating_panes=true { pane split_direction="horizontal" { pane pane } } tab name="zsh2" hide_floating_panes=true { pane } tab name="zsh3" hide_floating_panes=true { pane }

default_tab_template {
    children
    pane size=1 borderless=true {
        plugin location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
            format_left   "{mode} #[fg=#89B4FA,bold]{session} {tabs}"

// format_center "{tabs}" // format_right "{command_git_branch} {datetime}" format_space ""

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

            hide_frame_for_single_pane "false"

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

            tab_normal   "#[fg=#6C7086] {name} "
            tab_active   "#[fg=#9399B2,bold,italic] {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        "#[fg=#6C7086,bold] {format} "
            datetime_format "%A, %d %b %Y %H:%M"
            datetime_timezone "America/Edmonton"
        }
    }
}

}

The one that did work is just a single tab/pane with the above panel template. After running the simple the complex works. If you have zjstatus already downloaded by your template it works, otherwise it doesn't basically. It looked like it was trying to download a whole bunch of copies for each panel but if it existed already t it just copied it over.

imsnif commented 4 months ago

At a cursory glance without yet testing this, could you try to load zjstatus from the hardrive instead of the web to see if this is the issue? (essentially, instead of https://... you download the wasm file and replace it with file:/path/to/my/zjstatus.wasm)

If this still causes the issue, I'll take a closer look. In that case, could you help me out by pasting the layout inside code-blocks (place three backticks (```) in one line, then in the next line paste the layout, then after the last line place another three backticks)? Otherwise copy/pasting it will be difficult. Thanks!

zombiehoffa commented 4 months ago

it doesn't happen when loading from the file system, as I said I am pretty sure this is a problem with how the code is downloading what appears to be multiple times instead of figuring out it's the same thing and downloading it once. Once it's on the hard drive either through changing to loading from file or by loading a simpler layout that pulls it just once from the web, it works fine.