gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.5k stars 3.32k forks source link

Right status separator overlapping #245

Open haggen opened 5 years ago

haggen commented 5 years ago

First of all I love this project! It got me going with tmux and I'm enjoying every minute of it.

Now, I noticed a strange issue when customizing the separators; separators in the right status bar get cut roughly in half.

Screenshot from 2019-05-13 18 11 58

I'm using the same character on both sides here to make it more obvious. See how on the left you can see the right point of the triangle, but on the right side it's like half-width?

I was skimming through the code but I'm new to tmux and terminal ricing in general so I did't have much luck, but I noticed what I believe is a typo:

https://github.com/gpakosz/.tmux/blob/8809af7c9f6f8f325eb88dfc0b31a2f89e57ff53/.tmux.conf#L985

The substitution ${...:-...} is missing a colon isn't it?

gpakosz commented 5 years ago

Hello @haggen 👋

Can you please confirm which OS you're using, which terminal emulator and which tmux version? Then, what symbols are you using? Can you please paste the related section from your ~/.tmux.conf.local copy?

tmux_conf_theme_left_separator_main=...
tmux_conf_theme_left_separator_sub=...
tmux_conf_theme_right_separator_main=...
tmux_conf_theme_right_separator_sub=...

Can you also please paste the value you're using for tmux_conf_theme_status_left and tmux_conf_theme_status_right?

Finally can you please paste the output of tmux show -g status-left and tmux show -g status-right?


About substitutions, I'm using ${parameter-default} because I want people to be able to remove either status-left or status-right by doing

tmux_conf_theme_status_left=

or

tmux_conf_theme_status_right=
gpakosz commented 5 years ago

Nevermind,

You want

tmux_conf_theme_left_separator_main=''
tmux_conf_theme_left_separator_sub='|'
tmux_conf_theme_right_separator_main='#[reverse]#[noreverse]'
tmux_conf_theme_right_separator_sub='|'

The triangle symbol you're using needs to be reversed when displayed on the right side: this is what #[reverse] and #[noreverse] do.

Tell me if it's working for you

haggen commented 5 years ago

Hi @gpakosz :vulcan_salute:

I'm using:

Here's the relevant parts from my .tmux.conf.local, but you can see it in full too:

tmux_conf_theme_left_separator_main=''
tmux_conf_theme_left_separator_sub=''
tmux_conf_theme_right_separator_main=''
tmux_conf_theme_right_separator_sub=''

...

tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} '
tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %b %d %R | #{username}#{root} | #{hostname} '

You'll notice it seem to differ from what configuration I used when took the first screenshot. It is. That was just me trying to debug the issue. Here's a new screenshot displaying the same issue with my actual configuration:

Screenshot from 2019-05-13 19 17 05

This time I used the actual character I'd like to use. It's a reversed version of the triangle I used on the left. They are discrete characters. Both come from Powerline Extra Symbols.

See how the right bar separators are being cut in half? You may think something's up with that character in particular, but if I use on the right the same character I used on the left--which displays fine--you can see it's being cut in half too, illustrating my point that the issue is probably not with the character itself.

Screenshot from 2019-05-13 19 16 23

Finally I'll try reversing the character on the left and seeing what comes of it.


Oh silly me, forgot about that substitution, thank you for pointing it out.

haggen commented 5 years ago

It worked! :+1:

Reversing the character I use on the left status bar worked!

Screenshot from 2019-05-13 19 37 15

Though it's very counter intuitive, specially because these Powerline symbols always come in pair. It might be a good idea to mention it on the docs.

gpakosz commented 5 years ago

Well it seems U+E0B8 and U+E0BE are not treated as the reverse of each other 🤷‍♂️

Here

$ tmux set -g status-right 'XXX'

is displayed as image

While

$ tmux set -g status-right '#[reverse]#[noreverse]XXX'

is displayed as image

It seems it has to do with Unicode character characters width, which is often a pain between tmux and the terminal emulator. I'm afraid there's pretty much nothing I can do from my configuration.

haggen commented 5 years ago

Well using reverse worked on my end (refer to my last screenshot) so for now it's just a quirk and not a prohibitive issue as far as I know. I guess it's cool for now.