zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.62k stars 652 forks source link

Shorter tab names or ability to provide others #2177

Open txtyash opened 1 year ago

txtyash commented 1 year ago

The default tabs are named tab #x which could simply be numbers 1>2>3 it'll save a lot of space and makes navigation easier. Or let the users provide a default list for naming tabs. Let's say they provide this in the config: ["a", "b", "vim"....] Then first tab will be named "a"... Third will be named "vim".. & so on.

Kangaxx-0 commented 1 year ago

@imsnif Could you share the insight please. Change the tab name to 1>2>3 is an easy fix, or leave some customization option to end user like, adding an optional setting in config default_tab_nane, then concat the name with index together and display tab <tab_name> x

jaeheonji commented 1 year ago

Renaming tabs to simple numbers is an easy thing to do, but that's not going to be the solution. Because, some might like Tab #x. Therefore, it would be better to provide a way to change the expression of the tab name itself through config.

Kangaxx-0 commented 1 year ago

Because, some might like Tab #x.

I am not following this, can you elaborate?

Therefore, it would be better to provide a way to change the expression of the tab name itself through config.

I agree with this, my initial change was to add a config. However, I realized that change had a bigger implication, and I could not come up with an easy fix:

If I have a custom tan_name config called My awesome tab name -, then during Tab::new, current code looks like

        let name = if name.is_empty() {
            format!("Tab #{}", index + 1)
        } else {
            name
        };

With this, all my tabs will end up with the same tab name my awesome tab name -, instead of , my awesome tab name - 1, my awesome tab name - x.

jaeheonji commented 1 year ago

I am not following this, can you elaborate?

I simply like notations like Tab #x. I prefer it to just noting numbers.

And, As @zim0369 first mentioned, it seems better to add a config that allows changing tab names. A way to set initial tab names in the form of slices looks good. ["a", "b", "vim"....]. also I think It would be better if additional formatting was supported here.

Example:

// config.kdl

tab_name "a" "b" "Tab #{}"

For example, this is expressed in zellij as: a b Tab #3 Tab #4 ... And if you want to display only numbers, you can set it like this. tab_name "{}"

Perhaps this kind of implementation is expected to be complex, but I think it is a solution that can satisfy the needs of most users.