Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide_floating_panes doesn't work with a default_tab_template #2974

Open
i-am-logger opened this issue Dec 1, 2023 · 14 comments · May be fixed by #3846
Open

hide_floating_panes doesn't work with a default_tab_template #2974

i-am-logger opened this issue Dec 1, 2023 · 14 comments · May be fixed by #3846

Comments

@i-am-logger
Copy link

i-am-logger commented Dec 1, 2023

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"
            }
        }
    }
@imsnif
Copy link
Member

imsnif commented Dec 1, 2023

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).

@i-am-logger
Copy link
Author

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"; }
    }
}```

@imsnif
Copy link
Member

imsnif commented Dec 1, 2023

Alright. Could you please find a minimal reproduction?

@i-am-logger
Copy link
Author

yes, working on it

@i-am-logger
Copy link
Author

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
Copy link
Author

i-am-logger commented Dec 1, 2023

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
Copy link
Author

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

@imsnif imsnif changed the title hide_floating_panes doesn't seem to work hide_floating_panes doesn't work with a default_tab_template Dec 1, 2023
@i-am-logger
Copy link
Author

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
        }
    }
}

@imsnif
Copy link
Member

imsnif commented Dec 1, 2023

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%"
            }
        }
    }
}

@propilideno
Copy link

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

@cs-clarence
Copy link

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

@rockboynton
Copy link

rockboynton commented May 18, 2024

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.

@Armadillidiid
Copy link

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

@jwkicklighter
Copy link

I am having this same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants