wezterm
wezterm copied to clipboard
Add "stretch tabs to fill tab bar" option
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:
Wezterm:
Describe the solution you'd like Tabs that expand to fill up the tab bar.
https://github.com/wez/wezterm/discussions/1834 is another request for this.
@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
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.
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.
@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.
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?