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

Improve the select_tab switcher with context and [New tab] option #4523

Conversation

chriszarate
Copy link
Contributor

The PR improves the usability of the select_tab switcher to provide additional context and functionality. This makes it more useful as a kind of "on-demand" tab bar.

Lately I've been using tab_bar_style hidden for the simplicity and focus that it provides. In this mode, the select_tab command becomes very useful as a way to navigate tabs. Specifically, I use it to:

  1. Switch to an existing tab that I recently used.
  2. Get a quick awareness of what tabs I have open and decide whether to reuse a tab or open a new one.

The current select_tab implementation works well for the first use case but not the second. Personally, I want the ability to go to the select_tab screen and decide what to do next. This PR:

  • Adds a "[New tab]" option, which is helpful in situations where an existing tab cannot be reused.
  • Includes the current tab and marks it with "[current tab]".
  • Marks tabs with multiple windows with the window count ("[3 windows]").

I find this gives me a much better jumping off point:

Screen Shot 2022-01-15 at 8 28 24 PM

This is definitely a personal viewpoint, so I don't expect this to be merged as-is. I opened a PR because it seemed more illustrative than an issue. I'm happy to help iterate on this if there are ideas about how to improve it.

It's also worth noting that none of this strictly requires a change to kitty and is easily implementable as a kitten. I've done so here:

https://github.com/chriszarate/dotfiles/blob/daf4c3036e91f76e88c0f63f64b7c285e7029e68/kitty/kittens/select_tab.py

Improve the usability of the `select_tab` switcher to provide additional
context and functionality. This makes it more useful as a kind of
"on-demand" tab bar.

1. Add a "[New tab]" option, which is helpful in situations where an
   existing tab cannot be reused.

2. Include the current tab and mark it with "[current tab]".

3. Mark tabs with multiple windows with the window count ("[3
   windows]").
@page-down
Copy link
Contributor

I should point out that, as the name implies, the most important job of select_tab is to select the other tabs.

  • The first option cannot be New tab.
  • It doesn't make sense for the current tab to appear in the available options, but it can be displayed as text at the top. However, if you are already in the current tab, it is still redundant to show it again.

I understand your desire for a consistent presentation (in a list that is all executable next actions) and appreciate the inspiration, but this is, as you say, a personal preference.

@kovidgoyal
Copy link
Owner

I think having number of windows is a good idea have implemented it. As for showing the current tab, also no harm, as a subtitle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants