zellij-org / zellij

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

Cannot tell which pane is focused if there are 2 panes and `pane_frame` is disabled #2180

Open imsuck opened 1 year ago

imsuck commented 1 year ago

In tmux if there are 2 panes in a tab, then the pane border will be split into two. One with the inactive pane color and one with active pane color. But on zellij it's just the active pane color. This makes it impossible to tell which pane you have focused unless if you have pane_frame enabled.

https://user-images.githubusercontent.com/49095435/219952668-291490c6-8a35-47be-9ef5-d01656d078fc.mp4

imsnif commented 1 year ago

How do you know if up is right or left? This always bothered me in tmux.

imsuck commented 1 year ago

How do you know if up is right or left? This always bothered me in tmux.

If the upper pane is focused, the active pane color would be on the left half.

https://user-images.githubusercontent.com/49095435/220268658-10558cc2-200d-4015-a5ee-07a8bfd2827d.mp4


This is the code that tmux uses for handling 2-pane tabs.

imsnif commented 1 year ago

I know :)

I'm just not sure how I'm supposed to know this as a user without fiddling around with it (and then I know anyway).

Like, what's the UI logic here? Why up == left and not up == right?

imsuck commented 1 year ago

Well, I'm not quite sure about this one either.

imsnif commented 1 year ago

My philosophy is that it's better to not implement a UI than to implement a confusing UI.

zolrath commented 1 year ago

I think the logic here is supposed to be that (at least in western/LTR cultures) you read left to right, top to bottom.

So, in this case as we don't have top/bottom indicators they connect left and up (the start) with right and bottom (the end).

zolrath commented 1 year ago

I wonder if using ASCII characters for the line break between the two panes would be sufficient?

Something like

   [13:47] ~ top selected

└────────────────────────────────────────────────────────────────┘
   [13:47] ~ bottom unselected
   [13:47] ~ top unselected

┌────────────────────────────────────────────────────────────────┐
   [13:47] ~ bottom selected
                            ┐
                            │
                            │
[13:47] ~ left selected     │    [13:47] ~ right unselected
                            │
                            │
                            │
                            │
                            ┘
                                   │ 
                                   │ 
                                   │ 
  [13:47] ~ top left unselected    │
                                   │
┌──────────────────────────────────┤
  [13:47] ~ bottom left selected   │    [13:47] ~ right unselected
                                   │ 
                                   │ 
                                   │ 
                                   │ 
                                   ┘
Drugoy commented 1 year ago

I'd suggest something a bit more obvious. Maybe like this

$                      | $ 
$                      > $ echo this pane is active
$ echo inactive pane   > this pane is active
inactive pane          > $
$                      |

Or even some unicode symbols for arrows: https://symbl.cc/en/collections/arrow-symbols/ If using unicode symbols might cause some problems - there are these symbols from ascii table that I believe should be universally available: « » (these two, unfortunately, don't have similar pair for vertical indication) ├ ┤ ┴ ┬ ╠ ╣ ╩ ╦ the border might contain just 1/3/5 such symbol(s) or consist entirely of them. Or that part can be configurable.

imsnif commented 1 year ago

I wonder if using ASCII characters for the line break between the two panes would be sufficient?

Something like [sic]

This is my favorite.

I think the idea with the various arrow fonts is cool (we use some of them for our UI :) ), but I'm afraid they'll be a little disruptive. Lots of people using pane_frames false are doing so to make the UI as minimal as possible.

Any volunteers to implement?

Gryzor commented 1 year ago

Any volunteers to implement?

I'd love to, but I'm scared my extremely limited Rust knowledge will probably get in the way :/

Gryzor commented 1 year ago

@imsuck where would one "start" by attempting to implement this? what would be your starting point?

I am quite noob at Rust, but managed to compile the project (have to solve a terminal issue with the fonts but that's irrelevant I think).

(i found the Architecture.md doc, will look into it)

I feel tempted to say "I can't promise much" because despite my extensive programming "experience" (many years) I am a newbie with Rust and multi-platform terminal multiplexers, I may not be the right fit for this task, but I'd love to give it a try, time permitting.

marianoguerra commented 1 year ago

maybe "dim" the unfocused panes? have less contrast, less contrast or a lighter/darker background?

Gryzor commented 1 year ago

maybe "dim" the unfocused panes? have less contrast, less contrast or a lighter/darker background?

This introduces potential accessibility issues, as not all users may be able to distinguish them.

cbr9 commented 1 year ago

I know it is slightly unrelated, but what if there was an option to hide all pane frames while there is only one pane in that tab, and when the user opens a new pane, then show the frames?

Drugoy commented 1 year ago

@cbr9 Huh? That's already how it is, unless I misunderstand you.

cbr9 commented 1 year ago

No. As of now, if I set pane_frames = false, zellij will open with no pane frames, and if I open new panes, it will still not show pane frames. I would like an option to only hide the pane frames when there is only one pane open.

Drugoy commented 1 year ago

Just don't set it to false and you'll get what you want, probably.

Gryzor commented 1 year ago

Just don't set it to false and you'll get what you want, probably.

Not really, what @cbr9 wants is "only show frames if there's more than one pane", an option that doesn't currently exist.

Drugoy commented 1 year ago

I don't have frames when there's just one pane.

mejo13 commented 1 year ago

Hey, i'm currently trying to implement this and i was wondering whether it should be a settable option for which part of the boundarie relates to which pane?

imsnif commented 1 year ago

Hey @mejo13 - happy you're working on this. Maybe we can implement the idea from this comment? https://github.com/zellij-org/zellij/issues/2180#issuecomment-1439187219

I think that will be very clear and not require any configs.

Gryzor commented 1 year ago

Agree. I was gonna try to work on this, but if you want to, go for it @mejo13 I don't have much time, rust knowledge, and zellij codebase knowledge to probably do it right.

The way I though approaching it was mostly detecting whether frames were on/off and changing which characters the boundaries used when frames were off. But I didn't get further than finding where the boundaries were "drawn".

If you have a public fork/branch, I'd be happy to take a look at your approach, maybe there's something I can learn ;)

mejo13 commented 1 year ago

My bad, should have read the thread more carefully. Right now i have something working but it mimics tmux behavior and needs more work anyway. Going to wrap some things up and push it to GitHub then. I could give the proposed solution from #2180 a try nonetheless, but it would probably take some time. Sorry for the confusion!

voroskoi commented 1 year ago

Hi,

I just tried zellij a couple of days ago, and I really miss something similar. I do not like wasting space on these separators and there is a better way (for my taste). In tmux there are window-style and window-active-style options, so You can set different background for those. I usually set the active window to black (which is taken from the terminal, actually dark grey) and other windows to #000000. This way the background color defines the active window/pane. I would love that in zellij too.

Thanks,

am-zest commented 8 months ago

Hi,

I just tried zellij a couple of days ago, and I really miss something similar. I do not like wasting space on these separators and there is a better way (for my taste). In tmux there are window-style and window-active-style options, so You can set different background for those. I usually set the active window to black (which is taken from the terminal, actually dark grey) and other windows to #000000. This way the background color defines the active window/pane. I would love that in zellij too.

Thanks,

that's exactly what I do, though I set the active window to '#222222'

am-zest commented 8 months ago

I would vote strongly for dimming the inactive panes, similar to tmux, but I also think the point that someone made about accessibility might be valid. Ideally, multiple options would be available. I'd prioritize dimming the inactive panes. :)

doneill commented 4 months ago

maybe "dim" the unfocused panes? have less contrast, less contrast or a lighter/darker background?

I would vote strongly for dimming the inactive panes, similar to tmux, but I also think the point that someone made about accessibility might be valid. Ideally, multiple options would be available. I'd prioritize dimming the inactive panes. :)

Warp has a setting for this, it has been terribly difficult to know which pane is active especially when returning back to the terminal and start typing in the wrong pane 🤯

eins commented 3 months ago

maybe "dim" the unfocused panes? have less contrast, less contrast or a lighter/darker background?

I would vote strongly for dimming the inactive panes, similar to tmux, but I also think the point that someone made about accessibility might be valid. Ideally, multiple options would be available. I'd prioritize dimming the inactive panes. :)

Warp has a setting for this, it has been terribly difficult to know which pane is active especially when returning back to the terminal and start typing in the wrong pane 🤯

Oh I noticed that zellij doesn't have an option to displays the pane numbers, that could be an easy way to know in which pane you left zellij. Having dim unfocused panes can be a problem if you want to see logs for example in the no active panes.

tombh commented 3 weeks ago

Just to confirm: Zellij doesn't currently have a way to set the active pane's background colour? We're waiting on https://github.com/zellij-org/zellij/issues/2297 for that?