wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Add "stretch tabs to fill tab bar" option

Open y-mx-b opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe. Not much of a problem, but I think it'd be cool if Wezterm could support iTerm/Safari-style tabs.

iTerm: Screen Shot 2022-04-24 at 7 16 13 PM

Wezterm: Screen Shot 2022-04-24 at 7 16 36 PM

Describe the solution you'd like Tabs that expand to fill up the tab bar.

y-mx-b avatar Apr 24 '22 23:04 y-mx-b

https://github.com/wez/wezterm/discussions/1834 is another request for this.

wez avatar Apr 24 '22 23:04 wez

@y-mx-b The screenshot is quite simple. Is that all you are looking for it to be like? Simple tab with the name and an X to close? I think iTerm does tab tinting based on some options or rules but probably wont be a first implementation feature.

The biggest issue I see with trying to pull this off is the fact that the tabs are so damn customizable in WezTerm. There are quite a few things that would have to be removed and assumed when making the tab widths stretch/responsive.

  • Probably would force fancy tabs
  • Reduce customization levels
  • Disable window-right-status from being drawn into the same row/container or just disable it

digitallyserviced avatar Apr 25 '22 03:04 digitallyserviced

FWIW, if you're using the retro tabs, you can set https://wezfurlong.org/wezterm/config/lua/config/tab_max_width.html to a large number.

wez avatar Apr 25 '22 03:04 wez

In terms of implementation, if you wanted to take a crack at it, the relevant section of code for fancy tab bars is:

https://github.com/wez/wezterm/blob/3dfe75362ae74729e8b02f8a248df536236d5252/wezterm-gui/src/termwindow/render.rs#L681-L690

I think the thing to do is add a min_width constraint to the box model code that gets handled somewhere around here:

https://github.com/wez/wezterm/blob/3dfe75362ae74729e8b02f8a248df536236d5252/wezterm-gui/src/termwindow/box_model.rs#L592-L597

With that in place, then the remaining work is to add a config option for this, and then compute a reasonable min-width constraint when it is set.

wez avatar Apr 25 '22 03:04 wez

@y-mx-b The screenshot is quite simple. Is that all you are looking for it to be like? Simple tab with the name and an X to close? I think iTerm does tab tinting based on some options or rules but probably wont be a first implementation feature.

The biggest issue I see with trying to pull this off is the fact that the tabs are so damn customizable in WezTerm. There are quite a few things that would have to be removed and assumed when making the tab widths stretch/responsive.

  • Probably would force fancy tabs

  • Reduce customization levels

  • Disable window-right-status from being drawn into the same row/container or just disable it

Yes, I mostly just want the stretched tabs. Wezterm's tab bar is incredibly customizable, but I didn't look too much into it because I wasn't very interested in customizing the tabs. I do like the look of stretched tabs that fill out the tab bat though, which is why I'd like to see this feature added to this project. I also like how the fancy tab bar looks more than the retro tab bar.

Wish I could help with the implementation, but I'm not familiar with Rust or this project at all.

y-mx-b avatar Apr 25 '22 04:04 y-mx-b

FWIW, if you're using the retro tabs, you can set https://wezfurlong.org/wezterm/config/lua/config/tab_max_width.html to a large number.

This doesn't work, at least not the way expected. Is there a way to manually specify the width of new tabs?

DUOLabs333 avatar Aug 04 '23 23:08 DUOLabs333