Powerline: Gnome 3.22 support

Created on 1 Oct 2016  ·  44Comments  ·  Source: powerline/powerline

Here is what I see after Gnome 3.22 upgrade:

output

ctmux linux sforeign bug bug

Most helpful comment

Since this is still problematic, OS X/macOS users on a new-ish version iTerm2 might run into this problem if your profile is set to use Unicode version 9 char widths - the workaround here is to just uncheck that checkbox under Preferences -> Profiles -> Text -> Unicode.

All 44 comments

Powerline determines what to display, correctly writing this to the terminal is tmux’s responsibility. Your screenshot looks like there either is

  1. tmux incorrectly thinking that terminal is one cell wider then it actually is.
  2. there is one character for which tmux thinks it is one cell wide and terminal emulator thinks it is two cells wide.

Powerline cannot do anything with this. You may workaround the problem by choosing another set of characters (e.g. set top_level theme to ascii or find out and override just one offending character), but this is a tmux bug.

Looks like @frol is on Gnome too. I didn't have any problems with tmux 2.3.1 which was updated according to Arch package managers on Sep 30. Looks more like an issue with Gnome terminal and maybe powerline due to some mysterious bug. tmux without powerline works just fine in Gnome 3.22.

Works fine with urxvt!

In powerline.json change:

image

to

            "time": {
                    "before": " "
            },

@mrmodolo Yep, this helps!

@burningTyger I am using testing repos, so I got Tmux 2.3.1 and Gnome 3.22 the same day and just thought that it was Tmux incompatibility, but it seems I was wrong.

@mrmodolo the watch symbol is the culprit but the other symbol is not available in my powerline font so I just left the before string empty which solves it for now too. Thank you.

In my config, " " is the UTF8 char f017.
You can print the symbol in VIM:
Change to insert mode;
CTRL+v and then type uf017

Which Unicode character is the watch symbol that causes problems (in a yellow-background screenshot in a previous comment)?

(Note: U+F017 is in the private use area, on my system it appears similarly to the tilde (~) symbol, but maybe this is the one that shows up as a watch on your system?? If so then what did @mrmodolo actually recommend to change??)

$ printf "%d\n" \'image
8986
$ echo "obase=16; 8986" | bc
231A

In VIM type:
CTRL+v and then type uf231A

Now I have this!
image
I'm using Arch, but Ubuntu uses  in powerline by default!

So... do I get it right that:

  • with U+231A it works incorrectly,
  • with U+F017 instead at the same position it works correctly?

(Or is it the other way around? Sorry I'm quite lost.)

In my case, U+F017 at the same position works fine!
My config file is:

"time": {
"before": " "
},

Reading the gnome-terminal bugreport first I thougth it was a bash/zsh powerline prompt that misbehaved. Looking at the screencast here it rather looks to me that it's a powerline tmux status bar.

Could someone please point me to the quickest-shortest documentation I should follow to get tmux configured to powerline (so that I can reproduce this bug)? I have never used powerline, and I'm hardly familiar with tmux either, and Google gives way too many results. I'm happy to debug this issue, but I don't have time to get familiar with the powerline ecosystem. Thanks in advance!

I'm using arch...
yaourt -S python-powerline

In .tmux.conf...
run-shell "powerline-daemon -q"
source "/usr/lib/python3.5/site-packages/powerline/bindings/tmux/powerline.conf"

If problem is with tmux thinking that U+231A is wider then GNOME terminal thinks it is then problem should be perfectly reproducible without powerline at all: just make some status- option contain this symbol (note: I am not sure whether and which rendering optimizations tmux uses, so status-right should contain something).

Thanks for the information!

I'm on Ubuntu Yakkety (gtk+gnome 3.20 / glib 2.50.0 [which belongs to gnome 3.22] / glibc 2.24) with tmux-2.3 and gnome-terminal/vte git compiled manually. I cannot reproduce this bug (neither with powerline, nor with a simple status-right).

If problem is with tmux thinking that U+231A is wider then GNOME terminal thinks

This wouldn't explain the current problem. Then tmux would print one less character (because it thinks one is wider) and hence it wouldn't fill up the entire width. I think it is the opposite: tmux thinks it's a regular character, while gnome-terminal thinks it's a double wide. Hence it overflows.

As stated at https://bugzilla.gnome.org/show_bug.cgi?id=762052#c30, gnome-terminal (vte) uses g_unichar_iswide() instead of wcwidth() (which is used by xterm and probably tmux as well).

Could you please try these:

echo $'\u231A' | wc -L

This prints glibc's wcwidth(), I assume the output will be 1.

echo ABCDE; echo a$'\u231A'cde

Do the uppercase and lowercase letters align properly? I guess that in xterm they do, whereas in gnome-terminal they don't (the watch occupies 2 cells).

Could you please share your version of glib and glibc? My wild guess is that you have glib 2.50.1 whose changelog says "Update Unicode support to Unicode 9.0.0" and perhaps Unicode 9.0.0 increased the width of this codepoint.

Looks like my wild guess was true:

ftp://ftp.unicode.org/Public/8.0.0/ucd/EastAsianWidth.txt

2313..231F;N     # So    [13] SEGMENT..BOTTOM RIGHT CORNER

ftp://ftp.unicode.org/Public/9.0.0/ucd/EastAsianWidth.txt

2313..2319;N     # So     [7] SEGMENT..TURNED NOT SIGN
231A..231B;W     # So     [2] WATCH..HOURGLASS
231C..231F;N     # So     [4] TOP LEFT CORNER..BOTTOM RIGHT CORNER

The watch and hourglass codepoints (and maybe a whole lot more) became wide by Unicode 9.0.0.

gnome-terminal uses the new width if it's running with glib 2.50.1 or newer, whereas xterm and tmux rely on glibc whose latest release (2.24) still uses the old width.

I can't find the gnome-terminal bugreport linked here, so here it is for your reference:
https://bugzilla.gnome.org/show_bug.cgi?id=772812
https://bugzilla.gnome.org/show_bug.cgi?id=772890

Do the uppercase and lowercase letters align properly? I guess that in xterm they do, whereas in gnome-terminal they don't (the watch occupies 2 cells).

There is another possible glitch that I have with this symbol: both konsole and tmux think it is one cell wide, but font rendering library is not (can’t be?) told to scale it into that display cell (actual glyph is taken from another font because terminus does not have this glyph), resulting in something like

e is off compared to E

. This _does not_ lead to the problems people here are experiencing, but this can make your test yield incorrect results.

konsole is the only emulator I'm aware of that does this craziness of not aligning to cells.

In all other emulators the watch symbol might overflow to c's cell, but the letters will be exactly below each other: either C-c, D-d, E-e, or (as I expect in gnome-terminal with glib-2.50.1) D-c and E-d will align.

I have the same problem on Termite, with Arch x86 + tmux. However editing out the watch icon in themes/powerline.json isn't changing anything.

Appeared today in Debian Stretch (testing). I'm using LXDE and Tilda.
tmux version 2-3-1
tilda version 1.3.1-1+b1

I really don't know which glib/glibc packages you're interested in, so I've made a screenshot:
zrzut ekranu z 2016-10-19 14-10-01

Update: This is _Liberation Mono for Powerline_ font, but output from _Linux Libertine Mono_ is the same (and others' too, I suppose).

Edit: Editing watch icon (U+231A nor U+F017) doesn't work for me neither. Any suggestions?
Edit2: In my screenshot I've mistaken and used wc -l instead of wc -L, but in this example output is the same. 1.
Edit3: Finally, tmux+powerline works again, thank you! Deleted clock sign from /usr/local/lib/..., as mentioned above and from my user's local file in
~/.local/lib/python2.7/site-packages/powerline/config_files/themes/powerline.json
After restart it works like a charm.

@dunemkk , what do you mean by deleting the clock sign in /usr/local/lib ?

@s0r00t My bad. Updated my comment.
Now I see that this location wasn't mentioned at all.

At first, I didn't even know I have powerline.json file in my user's dir. I found that file is in
/usr/local/lib/python2.7/dist-packages/powerline/config_files/themes/powerline.json
(since I used similar location binding powerline for zsh/tmux/vim) and didn't bother to check if it's somewhere else in my system. Probably this is why it didn't work. ;P

ahaasler's commit helped me: https://github.com/ahaasler/dotfiles/commit/aafef1f7a0b5a1d398c8ac33062b5d223b9a25a6

Thanks, I fixed it.

Worked like a charm.
FYI: U+23F2 with two spaces behind, looks just like the old one (except not broken). Only with a timer clock instead of a watch.

Other possible, but not tested chars are:
U+23F0 (alarm clock)
U+1F570 (mantelpiece clock)
U+1F570 through U+1F567 (div. clock faces)

Thanks for the work around!

Since this is still problematic, OS X/macOS users on a new-ish version iTerm2 might run into this problem if your profile is set to use Unicode version 9 char widths - the workaround here is to just uncheck that checkbox under Preferences -> Profiles -> Text -> Unicode.

having this issue suddenly on ubuntu 16.10 - last week this didn't happen. weird. probably something got changed during an apt-get update or pip upgrade, dont remember.

so what's the official fix?

@binarykitchen same here since yesterday as well!

Found a solution

cp /usr/share/powerline/config_files/themes/powerline.json ~/.config/powerline/themes/

then edit ~/.config/powerline/themes/powerline.json and find a block that says:

                "time": {
                        "before": "  "
                },

I replaced the value for "before" with "◴ "

@CVirus thanks but in my case, there was already that watch char.

But I didn't have the json file in my .config folder ... could that be the cause?

And some comments on top of this thread say to remove or replace the watch char. Confused.

@binarykitchen replace the clock you have with the one I pasted or a with any other character

@CVirus will do - to clarify, do I have to restart something after replacing the character? my machine, the zsh session?

and to be clear, it only happens during a tmux session to my remote server. and i am only correcting that json on my side, the client, not on the server side.

let me know ...

@binarykitchen You need to restart whatever process powerline lives in. Most likely this means powerline-daemon, but not shell or tmux. Though zsh is special here: if you have zpython installed then powerline will live inside a shell process. This is not much likely to happen unless you installed zpython yourself.

@ZyX-I thanks - no idea if i have zpython installed and btw, i have installed powerline via apt-get, not pip.

and re my last question: "it only happens during a tmux session to my remote server" - how can i find out if the powerline problem is on the client or server side?

@binarykitchen Whatever application uses powerline, it uses powerline on the side it is being run.

@ZyX-I "Whatever application uses powerline, it uses powerline on the side it is being run."

-> my problem is that, when i run a ssh session over tmux i start to believe it's a problem with the powerline installation on server side. but the more i read about powerline, i guess it's a client side problem. it is really abstract ...

have restarted my machine and the bug still happens - any other clues? getting desperate here ...

if i cannot have a proper ssh session soon to check my server, i ll have to uninstall powerline :(

I just used the stopwatch instead of clock to fix this. So in /usr/share/powerline/config_files/themes/powerline.json, I changed these lines

"time": {
    "before": "◴ "
},

to

"time": {
    "before": "⏱ "
},

@binarykitchen Configuration is taken from the machine powerline is on. Displaying symbol happens on the client. Currently suggested fix is altering configuration.

If you did not configure themes just update all powerlines to develop version, it now uses theme without problematic symbols by default.

tried the stopwatch fix but nah, that didn't help

think i ll just uninstall powerline - sorry guys

@binarykitchen Maybe just use a space instead of any clock icons.

@binarykitchen Just changing the file is not enough. You also have to make powerline use the new configuration (maybe reboot is easiest). Maybe it's powerline-daemon using the old settings so killing that may work as well, however I'm not sure.

@liuhuiping2013 did you even read the comments above?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Chris-Bee picture Chris-Bee  ·  3Comments

guyzmo picture guyzmo  ·  5Comments

damienstanton picture damienstanton  ·  5Comments

kataev picture kataev  ·  6Comments

sbusch picture sbusch  ·  5Comments