zellij-org / zellij

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

Layout with focused stack pane does not expand focused pane #2271

Closed zolrath closed 1 year ago

zolrath commented 1 year ago

Hey hey! Excited to experiment with the new release. I've found an issue with stacked panes when used in a layout.

Issue

When creating a layout with stacked panes the final pane listed is always the expanded pane, even if another pane is set to focused.

  tab name="Test" split_direction="vertical" {
    pane size="65%"
    pane split_direction="horizontal" stacked=true {
      pane command="ls"
      pane { 
        command "ls"
        focus true
      }
      pane command="ls"
    }

image

Expectation

Baseline expectation here is that the focused pane would be expanded, not the last pane on the list.

My actual desire here is not to focus the middle pane though. In reality I'd prefer to be able to set an expanded true option, that way the middle pane can be expanded but I can have another interactive pane focused elsewhere (in this example, the size="65%" pane).

zellij --version: zellij 0.35.2

imsnif commented 1 year ago

Hey @zolrath - is there perhaps more to this layout? I tried reproducing this with it and couldn't.

zolrath commented 1 year ago

Here's the full config @imsnif , sorry for not including it verbatim the first time. Just tested it and still see the same result!

Using the latest version of zellij, fish shell, and wezterm in ubuntu via wsl2.

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 name="Test" split_direction="vertical" {
    pane size="65%"
    pane split_direction="horizontal" stacked=true {
      pane command="ls"
      pane { 
        command "ls"
        focus true
      }
      pane command="ls"
    }
  }
}
imsnif commented 1 year ago

Alright, reproducing it now - thanks!

Incidentally, this is also fixed by https://github.com/zellij-org/zellij/pull/2343 :)

I think there might be a few occasions here and there where this bug might pop up (it's unfortunately the result of some fragmented logic I'm slowly trying to consolidate) - so if you encounter it again please do ping!

imsnif commented 1 year ago

Actually - this was not entirely fixed, my mistake. I'm on it...

imsnif commented 1 year ago

Now it's fixed!