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

Add left status bar #1561

Closed
gegoune opened this issue Jan 17, 2022 · 8 comments
Closed

Add left status bar #1561

gegoune opened this issue Jan 17, 2022 · 8 comments
Labels
enhancement New feature or request fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.

Comments

@gegoune
Copy link
Sponsor

gegoune commented Jan 17, 2022

Is your feature request related to a problem? Please describe.
I would like to be able to format status bar in its entirety, not only right hand side with set_right_status.

Describe the solution you'd like
Replace set-right-status in favour of more generic status bar generator. I have something similar to vim's statusline in mind where one can influence generation of entire bar.

I can think of situation where current left hand side, tabs bar, is returned by builtin function and together with some control characters for aligning content, placed as per user's desire.

wezterm.on('update-status-bar', function(window, _)
  window:set_status_bar(
    wezterm.format { { Text = '[' .. window:active_workspace() .. ']' .. '<center from here>' ..window.tabwidget .. '<right align from here>' .. wezterm.strftime '%Y-%m-%d %H:%M '  } }
  )
end)

Describe alternatives you've considered
Leave things as they are, I am not sure if added complexity is worth it. tmux does have such flexibility though.

I am not sure about rate of refreshing the entire bar.

Additional context
As you mention on discussions' topic and I agree, this is rather low priority. I can definitely live with current degree of configurability here. Just putting it here as a food for thought, maybe someone (or yourself) can come up with sensical and better interface than one above.

(Loving wezterm, amazing job! Thanks a lot!)

@gegoune gegoune added the enhancement New feature or request label Jan 17, 2022
@wez
Copy link
Owner

wez commented Jan 18, 2022

I don't want to make the whole tab bar get parsed out of text; there are more structured ways to tackle that.
I'd prefer to interpret this issue as a request for a set_left_status_bar to mirror the current right status bar.
In my mind, the left status bar is a bit simpler than the right status bar, as it can unconditionally occupy the left space before the tabs are rendered. (The right bar has some math gymnastics to right align and truncate/hide behind other text).

@gegoune
Copy link
Sponsor Author

gegoune commented Jan 18, 2022

Feel free to completely scrap that issue, it's not that important at all.

@wez wez changed the title Status bar enhancement - ability to configure it in its entirety Add left status bar Jan 18, 2022
@Lenbok
Copy link

Lenbok commented May 7, 2022

A left-status-bar would be great. I would personally use it to show the workspace name (at the moment I have it on the right in wezterm, but I conceptually think it belongs closer to the tabs).

wez added a commit that referenced this issue Aug 7, 2022
@wez wez added the fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. label Aug 7, 2022
@wez
Copy link
Owner

wez commented Aug 7, 2022

This should be fixed now in main.

It typically takes about an hour before fixes are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer.

Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.

If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg file on macOS, a .zip file on Windows and an .AppImage file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.

If you are eager and can build from source then you may be able to try this out more quickly.

@wez wez closed this as completed Aug 8, 2022
@Lenbok
Copy link

Lenbok commented Aug 8, 2022

@wez Just to check in here, there is a update_right_status event but no update_left_status event. Are you envisioning that we would typically call both set_left_status and set_right_status from a function hooked into update_right_status? Or do you have a recommendation of where else to hook it?

@wez
Copy link
Owner

wez commented Aug 8, 2022

Ah, the update-right-status event is triggered whenever the status line needs to be updated, regardless of whether it is left or right.

@gegoune
Copy link
Sponsor Author

gegoune commented Aug 8, 2022

Thanks for adding it! Perhaps update-right-status could be aliased by update-status event with former getting removed with some deprecation notice and period?

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.
Projects
None yet
Development

No branches or pull requests

3 participants