You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can try building tmux against libutf8proc, or see if there is a later version of your libc, or see if you can find a font and terminal where the width of these symbols agrees with libc.
But you say the implementation, you mean, ArchLinux is broken? I have this issue for quite a long time I can't remember if it was since day one I started with tmux. If I have to apply patches, it's probable that they are needed in the official distribution packages. Replacing libc doesn't sound as a good idea, because it would affect the system entirely. Replacing terminal/font sounds a bit ad-hoc, I was a user of xfce4-terminal before termite and the problem was the same. So it seems the best option left is to try a tmux build against libutf8proc. I don't know exactly how to do it so I'll have a look. I still wonder, if it's an issue with system's locale implementation, why only tmux is affected? Because all terminal applications run outside tmux work fine.
Sadly, building with --enable-utf8proc made things worse. The former problem didn't get solved, and typing in the command line is now completely unpredictable. Example, my prompt is like:
~/Desktop ❯❯❯ |
Where | is cursor position, and it's now quite far from ❯❯❯.
I then type something:
~/Desktop ❯❯❯ ls|
And force tab completion:
~/Desktop ❯❯❯ ls |
The text gets moved back one char but the cursor is left in the same position, with one additional space before it. Now if I press backspace all the way trying to erase the text, I can't, it erases solely up to:
~/Desktop ❯❯❯ l|
I can't erase the first char, it's left there visually only, because internally it was. Pressing enter doesn't result in a non-existing command l. This is just one case, as a whole it's quite unpredictable now.
Reacted by Helge Rausch, Rainer Dreyer, Sahil Bajaj and WENTION
Did you entirely do "make clean" before rebuilding with utf8proc?
Probably these codepoints changed width in one of the newer Unicode versions.
Latest utf8proc is Unicode 9.0; glibc 2.23 is Unicode 8.0 and 2.24/2.25 is Unicode 9.0; glib (used by VTE) is Unicode 10.0 as of 2.53.4 and 9.0 as of 2.50.1 and 8.0 as of 2.47.1.
Anyway you need libc/utf8proc and terminal/font to be on the same version or you will have problems with symbols where the width disagrees.
Or it could just be a bug or disagreement in one of the other.
I've installed the package from AUR from scratch. I'll try the former test with more fundamental large unicode characters that didn't change width between unicode versions.
The only thing not worth is trying with utf8proc I think.... I'll try with it again, with a different terminal prompt, because my unicode one may be interfering.
@micm can you tell me which emoji font you use that displays 🤗🌟 in vim under tmux correctly (without ther overload issue)? I've changed to emojione and it had no effect.
My settings where this test always produce the same issue:
glibc 2.25 -> Unicode 9.0
glib 2.52 -> Unicode 9.0
With or without --enable-utf8proc
Only difference is that my prompt containing ❯❯❯ gets messy when --enable-utf8proc is passed. If I remove ❯❯❯ it gets back to normal, so with --enable-utf8proc these characters cause some issue. I've tried them with two fonts (Monoid and monofur for Powerline) but it didn't matter.
I don't have a font that shows the symbols, my font just shows them as boxes that cover two normal size characters. But on Ubuntu with glibc 2.24, tmux is correctly told that these are width 2. If I build with utf8proc (I have 2.0.2) they are also width 2:
Sorry to bother but I have another question I'd like to clear up. Just to fully diagnose the mutt use case and why it wraps like in that screenshot at the bottom.
The stack without tmux is:
mutt calculates chars using glibc, the emojis are counted as width 1.
termite uses glib, for which the chars are width 2.
It displays correctly but I don't know the explanation.
The stack with tmux is:
mutt calculates chars using glibc, the emojis are counted as width 1.
original tmux from master using glibc receives the char stream from mutt and counts emojis as width 1 too.
termite uses glib, for which the chars are width 2.
It displays incorrectly but I don't know the explanation.
I had the same issue as in #1057 (comment), which disappeared when I installed libutf8proc 2 via libutf8proc-julia and rebuilt tmux (the current version in Arch Linux). I'm using fish (the shell) and my only remaining problem is that fish's right prompt still doesn't align with the right border of the shell, because apparently fish doesn't get the correct character widths either. But I can do without the right prompt for now. Thanks, @oblitum, for figuring this out! This already improved my quality of life significantly! #firstworldproblems
@neo1691 the correct fix is to figure out how to get Unicode width calculation in sync with all the programs involved, for your platform. Since Sep 15, 2017 this is now working on ArchLinux because of that, glibc was upgraded to 2.26, supporting Unicode 10, and many programs rely on it (tmux, mutt, etc). Termite, which uses glib, not glibc, has compatible Unicode char widths, so nothing breaks.
Thanks a lot guys. The MBP I was using with the configured bash broke and I
am using a temporary MBP for now, with plain vanilla bash. I will configure
my bash for emojis again and use the solutions.
Much appreciated.
@accessd I finally got time to look into this after setting up everything again on a new Mac. Thanks a lot for linking the solution. The problem is solved, however there is one issue that still persists.
When iterm is in window mode (not full screen), and you try to run a command that goes onto the next line, iterm makes it wrap onto the same line. Like the screenshot below:
Activity
oblitum commentedon Sep 7, 2017
It's specially problematic with terminal IM applications, like weechat for example. Too many emojis == broken UI.
nicm commentedon Sep 7, 2017
This is a most likely a problem with your system locale implementation. It is telling tmux these codepoints are width 1:
1504743323.298691 input_utf8_close 4 '\360\237\244\227' (width 1)
1504743323.298807 input_utf8_close 4 '\360\237\214\237' (width 1)
But in fact they should be width 2.
You can try building tmux against libutf8proc, or see if there is a later version of your libc, or see if you can find a font and terminal where the width of these symbols agrees with libc.
oblitum commentedon Sep 7, 2017
Hi, I didn't understand how my locale implementation is the issue, for what it's worth I use:
But you say the implementation, you mean, ArchLinux is broken? I have this issue for quite a long time I can't remember if it was since day one I started with tmux. If I have to apply patches, it's probable that they are needed in the official distribution packages. Replacing libc doesn't sound as a good idea, because it would affect the system entirely. Replacing terminal/font sounds a bit ad-hoc, I was a user of xfce4-terminal before termite and the problem was the same. So it seems the best option left is to try a tmux build against libutf8proc. I don't know exactly how to do it so I'll have a look. I still wonder, if it's an issue with system's locale implementation, why only tmux is affected? Because all terminal applications run outside tmux work fine.
oblitum commentedon Sep 7, 2017
Sadly, building with
--enable-utf8procmade things worse. The former problem didn't get solved, and typing in the command line is now completely unpredictable. Example, my prompt is like:Where
|is cursor position, and it's now quite far from❯❯❯.I then type something:
And force tab completion:
The text gets moved back one char but the cursor is left in the same position, with one additional space before it. Now if I press backspace all the way trying to erase the text, I can't, it erases solely up to:
I can't erase the first char, it's left there visually only, because internally it was. Pressing enter doesn't result in a non-existing command
l. This is just one case, as a whole it's quite unpredictable now.nicm commentedon Sep 7, 2017
Did you entirely do "make clean" before rebuilding with utf8proc?
Probably these codepoints changed width in one of the newer Unicode versions.
Latest utf8proc is Unicode 9.0; glibc 2.23 is Unicode 8.0 and 2.24/2.25 is Unicode 9.0; glib (used by VTE) is Unicode 10.0 as of 2.53.4 and 9.0 as of 2.50.1 and 8.0 as of 2.47.1.
Anyway you need libc/utf8proc and terminal/font to be on the same version or you will have problems with symbols where the width disagrees.
Or it could just be a bug or disagreement in one of the other.
oblitum commentedon Sep 7, 2017
I've installed the package from AUR from scratch. I'll try the former test with more fundamental large unicode characters that didn't change width between unicode versions.
oblitum commentedon Sep 7, 2017
The only thing not worth is trying with utf8proc I think.... I'll try with it again, with a different terminal prompt, because my unicode one may be interfering.
nicm commentedon Sep 7, 2017
Try something like ハ (printf "\343\203\217") which is width 2 on all the platforms I have here.
oblitum commentedon Sep 7, 2017
OK, the problem doesn't show up with:
So, according with your Unicode version listing, this is quite a mess to try to solve. No idea whether I'll figure it out. Thanks for the help.
oblitum commentedon Sep 7, 2017
cc #836 as it's related.
oblitum commentedon Sep 8, 2017
@micm can you tell me which emoji font you use that displays 🤗🌟 in vim under tmux correctly (without ther overload issue)? I've changed to emojione and it had no effect.
My settings where this test always produce the same issue:
--enable-utf8procOnly difference is that my prompt containing
❯❯❯gets messy when--enable-utf8procis passed. If I remove❯❯❯it gets back to normal, so with--enable-utf8procthese characters cause some issue. I've tried them with two fonts (Monoid and monofur for Powerline) but it didn't matter.oblitum commentedon Sep 8, 2017
by the way, these version numbers correspond to the current state of ArchLinux.
nicm commentedon Sep 8, 2017
I don't have a font that shows the symbols, my font just shows them as boxes that cover two normal size characters. But on Ubuntu with glibc 2.24, tmux is correctly told that these are width 2. If I build with utf8proc (I have 2.0.2) they are also width 2:
You can check by doing:
Make sure your log shows this is width 2 and see if you still have problems.
75 remaining items
nicm commentedon Sep 8, 2017
I don't know if those symbols are changed in 9.0 or 10.0 and I don't know what version of Unicode glibc 2.25 actually is.
oblitum commentedon Sep 8, 2017
OK, at least they claim Unicode 9 on their NEWS file.oblitum commentedon Sep 8, 2017
Scratch that, I've confused glib NEWS with glibc NEWS, I don't know about the latter.
oblitum commentedon Sep 8, 2017
For what's worth, I checked their NEWS and there's no claim of full support for Unicode 9, they jump from 8 to 10.
oblitum commentedon Sep 8, 2017
Sorry to bother but I have another question I'd like to clear up. Just to fully diagnose the mutt use case and why it wraps like in that screenshot at the bottom.
The stack without tmux is:
It displays correctly but I don't know the explanation.
The stack with tmux is:
It displays incorrectly but I don't know the explanation.
oblitum commentedon Sep 9, 2017
@nicm I don't know whether it was b/c I asked about the update on #ArchLinux yesterday, but they upgraded yesterday, and... IT'S FIXED!
I guess my last question doesn't matter anymore, except for sanity sake.
oblitum commentedon Sep 15, 2017
This escalated fast, now I have color emojis on termite without asking.
tsujigiri commentedon Oct 12, 2017
I had the same issue as in #1057 (comment), which disappeared when I installed libutf8proc 2 via
libutf8proc-juliaand rebuilt tmux (the current version in Arch Linux). I'm using fish (the shell) and my only remaining problem is that fish's right prompt still doesn't align with the right border of the shell, because apparently fish doesn't get the correct character widths either. But I can do without the right prompt for now. Thanks, @oblitum, for figuring this out! This already improved my quality of life significantly! #firstworldproblemsan00bhav commentedon Jan 17, 2018
I am having the same problem with tmux built without/without libutf8proc on MacOS High Sierra. Does anyone knows a fix here?
oblitum commentedon Jan 17, 2018
@neo1691 the correct fix is to figure out how to get Unicode width calculation in sync with all the programs involved, for your platform. Since Sep 15, 2017 this is now working on ArchLinux because of that, glibc was upgraded to 2.26, supporting Unicode 10, and many programs rely on it (tmux, mutt, etc). Termite, which uses glib, not glibc, has compatible Unicode char widths, so nothing breaks.
accessd commentedon Apr 26, 2018
@neo1691 If you are using iTerm try this solution gpakosz/.tmux#60 (comment)
an00bhav commentedon Apr 26, 2018
an00bhav commentedon May 29, 2018
@accessd I finally got time to look into this after setting up everything again on a new Mac. Thanks a lot for linking the solution. The problem is solved, however there is one issue that still persists.
When iterm is in window mode (not full screen), and you try to run a command that goes onto the next line, iterm makes it wrap onto the same line. Like the screenshot below:
Any idea what might be causing this?
lock commentedon Feb 15, 2020
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.