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

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

Open
brandon-leapyear opened this issue Jan 26, 2023 · 4 comments
Open

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

brandon-leapyear opened this issue Jan 26, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@brandon-leapyear
Copy link

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

@brandon-leapyear brandon-leapyear added the bug Something isn't working label Jan 26, 2023
@eklmv
Copy link

eklmv commented Jul 1, 2023

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

@yriveiro
Copy link

yriveiro commented Nov 8, 2024

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

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

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 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants