powerline / powerline

Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
https://powerline.readthedocs.org/en/latest/
Other
14.39k stars 997 forks source link

tmux supports multiline status since 2.9 #2047

Open BlitzKraft opened 4 years ago

BlitzKraft commented 4 years ago

From tmux man page:

status [off | on | 2 | 3 | 4 | 5]
          Show or hide the status line or specify its size.  Using on gives a status line one row in height; 2, 3, 4 or 5 more rows.

I don't think powerline currently supports that.

BlitzKraft commented 4 years ago

My proposed Solution:

In the tmux config json, add a top level key, say status_line_1, incremented for each line as the config desires. Each of those keys has a segments sub-key which is configured as usual with desired set of segments.

PH111P commented 4 years ago

Perhaps we should think of a more general solution to configure how many bars each binding has and where each of those bars accepts segments. For instance, the lemonbar binding (and I guess also the vim and (in theory the shell) bindings) could in principle also display segments in the center of the bar. Also, some shells already have above lines.

I propose the following, albeit somewhat complicated solution: Add (yet) another config for each binding that specifies where this binding accepts segments, where the default would look like:

"bars": {
   "default": {
      "left": {
          "align": "left"
      },
      "right": {
          "align": "right"
      }
   }
}

Other bars could then be added to the bars array by giving them a name and specifying how they should behave:

"bars": {
   "default": { "left": { "align": "left" }, "right": { "align": "right" } },
   "above": { "left": { "align": "left" }, "right": { "align": "right" } },
   "fancy new bar": { "center": { "align": "center" } },
}

Ideally, a user wold not need to touch these configs (only if the user wants to create a new binding with some non-default bars), but if for some reason a new version of a binding allows more bars, we can support that more easily (and users could, in fact, then activate such new bars themselves). (Using such a kinda complicated config also allows for more advanced things in the future, such as e.g. configuring the order in which "left" and "right" are rendered for certain bindings or setting a maximum length for certain parts, etc.)

For configuring segments for these new bars, nothing would need to be changed in old user configurations (when making the default bar the top level bar and adding all other bars as the above line was added before):

{
   "segments": {
      "left": [ ],
      "right": [ ],
      "above": { "left": [ ], "right": [ ] },
      "fancy new bar": { "center": [ ] }
   }
}

As an alternative, we could also think about somehow hacking similar features in the "local_themes" thing, however, that seems to be less flexible (but would probably cost less time to implement).

BlitzKraft commented 4 years ago

I like the idea of named bars. However, that doesn't convey which bar is which. Makes editing/copying configs need more trial and error. A config of 5 bars can easily get confusing. Especially when rearranging bars. A bar named "above" could as well be the bottom most. May be have a standard name for each bar (with a count) and have an "alias" defined to address it by name?

PH111P commented 4 years ago

Sure, the above was just an example. Personally, I'd favor some solution with numbers as well; perhaps default, above-1 to above-4 could work, where above-x would be the bar that is “above x other bars”.

BlitzKraft commented 4 years ago

tmux's implementation is that default bar is above everything else. All the other bars are below it. This might seem like splitting hairs, but for a general solution, we should forego all relative positioning. Generic names like bar-1, bar-2 etc., would be more suitable. The ordering will vary based on the application.

I think your solution with a "bars" key with a "default" is a good way to handle this.

Also, I second taking time to implement this as well as we can instead of creating a temporary quickfix.

PH111P commented 4 years ago

Ah, I wasn't aware of that detail. In that case, I fully support your opinion.

BlitzKraft commented 4 years ago

As far as I can understand, all the status lines are going to be stacked on the bottom. I am working on this.

GamerGirlandCo commented 1 month ago

any updates?