zellij icon indicating copy to clipboard operation
zellij copied to clipboard

hide_floating_panes doesn't work with a `default_tab_template`

Open i-am-logger opened this issue 1 year ago • 14 comments

Hi, here is the layout i'm loading, btop always shows even though hide_floating_panes=true

using zellij 0.38.1 on nixos

PS. is there a way to setup keybinding to show/hide the pane?

    tab name="Dev" focus=true hide_floating_panes=true {
        pane split_direction="vertical" {
            pane name="editor" borderless=true {
                edit "."
            }
        }
        pane split_direction="vertical" size=8 {
            pane name="cargo run" borderless=true {
                command "cargo" 
                args "run"
            } 
            pane size="20%" borderless=true
        }
        floating_panes {
            pane {
                x "10%"
                y "10%"
                width "80%"
                height "80%"
                command "btop"
            }
        }
    }

i-am-logger avatar Dec 01 '23 11:12 i-am-logger

Works for me...

What I'm doing: I placed a layout node around it and loaded it with zellij -l /path/to/layout.kdl. The layout is loaded and btop is only triggered when I trigger the floating panes with Ctrl p + w. Also, this is the only way to trigger floating panes unless they're a plugin (and then you can focus the pane specifically with the LaunchOrFocus binding).

imsnif avatar Dec 01 '23 11:12 imsnif

this is my full layout

layout name="sky360" {
    default_tab_template {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        children
        // TODO: figure out how to show/hide a pane
        // pane size=2 borderless=true {
        //     plugin location="zellij:status-bar"
        // }
    }

    tab name="Sky360-Dev" focus=true hide_floating_panes=true {
        pane split_direction="vertical" {
            pane name="editor" borderless=true {
                edit "."
            }
        }
        pane split_direction="vertical" size=8 {
            pane name="cargo run" borderless=true {
                command "cargo" 
                args "run"
            } 
            pane size="20%" borderless=true
        }
        floating_panes {
            pane {
                x "10%"
                y "10%"
                width "80%"
                height "80%"
                command "btop"
            }
        }
    }
    tab name="terminal" {
        pane {
            borderless true
        }
    }
    // tab name="browser" {
    //     pane {
    //         command "w3m"
    //         args "https://search.nixos.org/packages"
    //         borderless true
    //     }
    // }
    tab name="btop" {
        pane {
            command "btop"
            borderless true
        }
    }
}

keybinds {
    shared {
        bind "Alt 1" { Run "git" "status"; }
        bind "Alt 2" { Run "git" "diff"; }
    }
}```

i-am-logger avatar Dec 01 '23 11:12 i-am-logger

Alright. Could you please find a minimal reproduction?

imsnif avatar Dec 01 '23 11:12 imsnif

yes, working on it

i-am-logger avatar Dec 01 '23 11:12 i-am-logger

it also seems that if i don't have the defalt_tab_template, the _hide_floating_panes is causing an error

image

i-am-logger avatar Dec 01 '23 11:12 i-am-logger

this is minimum without default_tab_template... this one fail with error

layout {
    tab focus=true hide_floating_panes=true {
        pane split_direction="vertical" {
            pane
        }
        pane split_direction="vertical" size=8 {
            pane
            pane
        }
        floating_panes {
            pane {
                x "10%"
                y "10%"
                width "80%"
                height "80%"
            }
        }
    }
}


this is minimum with default_tab_template

layout {
    default_tab_template {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        children
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }

    tab focus=true hide_floating_panes=true {
        pane split_direction="vertical" {
            pane
        }
        pane split_direction="vertical" size=8 {
            pane
            pane
        }
        floating_panes {
            pane {
                x "10%"
                y "10%"
                width "80%"
                height "80%"
            }
        }
    }
}

i-am-logger avatar Dec 01 '23 11:12 i-am-logger

the most important for me is to be able to do keybinding to toggle a pane. not sure if its a feature to be added or already exists

i-am-logger avatar Dec 01 '23 11:12 i-am-logger

looks like the code samples doesn't work https://zellij.dev/documentation/creating-a-layout#hide_floating_panes

image

layout {
    tab name="Tab #1" hide_floating_panes=true {
        pane
        pane
        floating_panes { // will start hidden
            pane
            pane
        }
    }
}

i-am-logger avatar Dec 01 '23 12:12 i-am-logger

Friend, respectfully: let's please try to keep the chatter here to a minimum. Otherwise it gets hard to get into context and understand what the issue is about when we try to fix it. The only thing I was able to reproduce from the layouts in this issue was the combination of default_tab_template and hide_floating_panes=true. Everything else works for me.

Please be sure you're on the latest version. If you find other issues, please report them with a minimal reproduction (thanks for finding one here) one issue per reported problem, and if you're unsure or need support, please ask on discords/matrix.

Thanks.

To recap, this issue is about the following layout not hiding floating panes, everything else works at the time of writing:

layout {
    default_tab_template {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        children
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }

    tab hide_floating_panes=true {
        pane
        floating_panes {
            pane {
                x "10%"
                y "10%"
                width "80%"
                height "80%"
            }
        }
    }
}

imsnif avatar Dec 01 '23 12:12 imsnif

I have the same issue, to solve it temporarily i am repeating the code without using default_tab_template

propilideno avatar Mar 16 '24 22:03 propilideno

Same issue here, doesn't work with tab_template and new_tab_template as well.

cs-clarence avatar Apr 14 '24 02:04 cs-clarence

I have the issue with default_tab_template, but it seems to work with new_tab_template. Actually, I think the issue is hide_floating_panes=true doesn't work for predefined tab layouts.

rockboynton avatar May 18 '24 22:05 rockboynton

Just encountered this issue. hide_floating_panes=true doesn't work when used along default tab layouts.

Armadillidiid avatar Aug 12 '24 07:08 Armadillidiid

I am having this same issue.

jwkicklighter avatar Oct 09 '24 20:10 jwkicklighter