Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnome 3.22 support #1652

Closed
frol opened this issue Oct 1, 2016 · 44 comments
Closed

Gnome 3.22 support #1652

frol opened this issue Oct 1, 2016 · 44 comments

Comments

@frol
Copy link

frol commented Oct 1, 2016

Here is what I see after Gnome 3.22 upgrade:

output

@ZyX-I
Copy link
Contributor

ZyX-I commented Oct 1, 2016

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.

@burningTyger
Copy link

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.

@mrmodolo
Copy link

Works fine with urxvt!

@mrmodolo
Copy link

In powerline.json change:

image

to

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

@frol
Copy link
Author

frol commented Oct 13, 2016

@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.

@burningTyger
Copy link

@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.

@frol frol changed the title Tmux 2.3 support Gnome 3.22 support Oct 13, 2016
@mrmodolo
Copy link

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

@egmontkob
Copy link

egmontkob commented Oct 13, 2016

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??)

@mrmodolo
Copy link

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

In VIM type:
CTRL+v and then type uf231A

@mrmodolo
Copy link

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

@egmontkob
Copy link

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.)

@mrmodolo
Copy link

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

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

@egmontkob
Copy link

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!

@mrmodolo
Copy link

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"

@ZyX-I
Copy link
Contributor

ZyX-I commented Oct 13, 2016

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).

@ZyX-I ZyX-I added the e:linux label Oct 13, 2016
cscutcher added a commit to cscutcher/safe_home that referenced this issue Oct 13, 2016
So I'm getting this weird issue where the powerline status line repeats
itself infinitely up the terminal.
This appears to be the result of either tmux or my terminal emulator
incorrectly guessing the width of the characters in question.

After much googlin' the best description of the problem I've found is a
bug report on powerline:
powerline/powerline#1652

Unfortunately the powerline author, rightly or wrongly, has said it's
nothing to do with powerline.

I've yet to find a bug in gnome-terminal or tmux that covers the same
issue.

Switching to the ascii based theme for tmux should work for now
@egmontkob
Copy link

egmontkob commented Oct 13, 2016

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.

@egmontkob
Copy link

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.

@egmontkob
Copy link

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

@ZyX-I
Copy link
Contributor

ZyX-I commented Oct 14, 2016

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.

@egmontkob
Copy link

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.

@BenBergman
Copy link

Thanks for the work around!

paulcollinsiii added a commit to paulcollinsiii/salty that referenced this issue Jan 19, 2017
paulcollinsiii added a commit to paulcollinsiii/salty that referenced this issue Jan 19, 2017
@shawnrc
Copy link

shawnrc commented Jan 19, 2017

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.

@binarykitchen
Copy link

binarykitchen commented Jan 25, 2017

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?

@CVirus
Copy link

CVirus commented Jan 25, 2017

@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 "◴ "

@binarykitchen
Copy link

@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?

@binarykitchen
Copy link

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

@CVirus
Copy link

CVirus commented Jan 25, 2017

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

@binarykitchen
Copy link

@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 ...

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 25, 2017

@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.

@binarykitchen
Copy link

@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?

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 26, 2017

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

@binarykitchen
Copy link

@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 :(

@fazlearefin
Copy link

fazlearefin commented Jan 26, 2017

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": "⏱ "
},

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 26, 2017

@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.

@binarykitchen
Copy link

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

think i ll just uninstall powerline - sorry guys

@fazlearefin
Copy link

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

@beoldhin
Copy link

@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.

prydie added a commit to prydie/dotfiles that referenced this issue Feb 2, 2017
Powerline running via tmux in Gnome shell was drawing a new status line
rather than updating the existing one each clock tick as per
powerline/powerline#1652.
taintedkernel pushed a commit to taintedkernel/config-powerline that referenced this issue Mar 21, 2017
@X-dark
Copy link

X-dark commented Nov 16, 2017

@liuhuiping2013 did you even read the comments above?

eellson added a commit to eellson/dotfiles that referenced this issue Nov 20, 2017
Some quirk is causing these characters to cause the statusline to
duplicate instead of refresh. Seems related to powerline/powerline#1652
trekdemo added a commit to trekdemo/.dotfiles that referenced this issue Oct 24, 2018
trekdemo added a commit to trekdemo/.dotfiles that referenced this issue Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests