wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
18.11k stars 809 forks source link

panes argument to format-tab-title only contains zoomed pane #3013

Open brandon-leapyear opened 1 year ago

brandon-leapyear commented 1 year ago

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20230125-180646-f15bb186

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Including #panes in the tab title in format-tab-title shows 1 when a pane is zoomed. I would think that panes contains all of the panes, even if one is zoomed.

If this is the intended behavior, it'd be nice if 1) the docs could mention this, and 2) TabInformation could expose the total number of panes, even if one is zoomed

To Reproduce

With the below configuration, the tab shows 1 when a pane is zoomed

Configuration

wezterm.on('format-tab-title', function(tab, tabs, panes, config, hover, max_width)
  return #panes
end)

Expected Behavior

No response

Logs

No response

Anything else?

No response

eklmv commented 1 year ago

+1 Wanted to expose all panes in tab bar to be aware of them when zoomed, but can access only zoomed pane.

yriveiro commented 3 weeks ago

+1 on this,

I would like to have in my tab if a pane is zoomed or is not, but if it's only one pane it doesn't make sense to add the icon.

masriomarm commented 2 weeks ago
wezterm.on( 'format-tab-title', function(tab, tabs, panes, config, hover, max_width)
  local mux_tab = wezterm.mux.get_tab(tab.tab_id)
  local tab_panes = mux_tab:panes()

  -- `#tab_panes` is number of total panes per tab
  if #tab_panes > 1 then
  -- do needed logic.
  end

end

This may help.

yriveiro commented 2 weeks ago
wezterm.on( 'format-tab-title', function(tab, tabs, panes, config, hover, max_width)
  local mux_tab = wezterm.mux.get_tab(tab.tab_id)
  local tab_panes = mux_tab:panes()

  -- `#tab_panes` is number of total panes per tab
  if #tab_panes > 1 then
  -- do needed logic.
  end

end

This may help.

It worked indeed 🥳