-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
tmux: enable utf8proc #5665
tmux: enable utf8proc #5665
Conversation
If this is recommended for all users, do you think it's worth revisioning the formula so that everyone is upgraded to this? |
@BrewTestBot test this please |
Can you provide more details as to when this is needed? Is it needed when using Terminal.app? |
8f44d13
to
6a8fb21
Compare
6a8fb21
to
679e336
Compare
Probably. I updated the PR.
Changes introduced in tmux 2.2 removed much of tmux's built in handling for unicode in favor of relying on system libraries. This cleaned up the codebase and, on many operating systems, improved tmux's support of unicode. However, the Mac's This is what caused people to have lots of problems with tmux on mac for 2.2, especially if they had unusual characters for terminal prompts or tmux status lines. I worked with the tmux author to integrate optional support for When utf8proc is enabled, all unicode character widths are calculated using it, instead of the built in I should note that there are a few edge cases that I believe should be updated within utf8proc (detailed here: JuliaStrings/utf8proc#83). However, by and large, it is a massive improvement over the mac's built in libraries. To answer your question, yes, it greatly improves support for wide characters in Terminal.app, iTerm2.app, any terminal in which tmux is run. |
Ok, thanks for the comprehensive response @joshuarubin! |
Thanks again for your contribution to Homebrew! Without people like you submitting PRs we couldn't run this project. You rock! |
Thanks a bunch! |
@joshuarubin I think this change has caused |
I was able to reproduce this, only after installing spacemacs though (I'm not much of an emacs guy). It seems that some of the characters used in the mode line are getting their width calculated differently (from before, and from how the terminal calculates character width) by utf8proc which is causing a line overflow. Disabling the mode line should fix the rendering (or at least prove that it is causing the issue). This is a dicey issue. The problem is that wide characters (like emoji) should usually be rendered with 2 columns, but that Terminal.app, iTerm2.app and likely others actually render it as 1 column (try running Figuring out the width a character should be is one thing (which utf8proc does very well). Figuring out the width that the terminal actually displays it as is another issue. It probably isn't realistic to try to reconcile all of these differences (where the terminal will almost always be the offender if utf8proc is used). iTerm2.app (nightly) has an option to enable Unicode 9 character widths to address this issue, but that breaks a whole lot of other things and really isn't safe to enable yet. I already override some of utf8proc's calculations here to get better compatibility with how terminals actually render the characters. If we can identify the characters causing the issue, we may be able to patch it in homebrew, though I am not sure if it will be accepted upstream in tmux, particularly if we have many individual cases to check and can't just use a unicode category. |
Just a note to avoid people wasting time: if it's not accepted upstream we won't accept it in Homebrew either. |
This causes some horrible rendering glitches for me (reported in tmux/tmux#632), so I've been forced to uninstall the Homebrew-supplied tmux and build my own without Is there a way to make this optional or overridable? Feels like there may be a long tail of issues in utf8proc that may take a while to address upstream. |
I am starting to think the same. I worked around it by reverting my local Homebrew repo to the commit before this change was added, installed tmux and used This was absolutely a breaking change for me. I've yet to discover the exact cause of my rendering glitch, but I'd like to be able to continue using the latest It may be worth mentioning that while yet I was aware of the issues this was trying to solve, the bugs it introduces for me are worse than the original problem. |
I'd like to get @joshuarubin's thoughts on this. |
@MikeMcQuaid: iTerm. |
@MikeMcQuaid I've replicated my issues in both iTerm and Terminal.app, but I primarily use iTerm. |
Can we get some examples of the problems? Are you using uncommon fonts or symbols? The best thing I can think would be to make the utf8proc change configurable in the brew file itself so people can opt out of it if it's not working for them. |
@joshuarubin An option is the easy way out. We need to decide what the default should be. I'm thinking we should defer to |
@joshuarubin The only place I've hit it was using Spacemacs (Emacs). It's probably worth mentioning that I reverted back when I commented above / provided the YouTube link, which was probably within a few hours of finding it. So I didn't have much time to find other issues. |
I doubt that the font is relevant. See these issues in the tmux repo for examples:
Seems like lots of people are running into this.
I don't know why the default was changed, but |
There is a change in tmux not yet in the latest release (I think) that removes some character overrides that were put in place when utf8proc was used. Because of this, it's unclear in each of these cases, 1) is utf8proc used and 2) were the overrides in place if it was? |
All of my testing has been against the current |
I think it's worth reverting back to the |
So that means the overrides are no longer in place. The overrides were for all things in the unicode "symbol" category. They protected people using things like powerline on a unicode8 terminal. If you use iterm2, switch to the nightly and enable unicode9 widths, see if that helps. |
Can we keep utf8proc as a brew level option in any case? |
Sure. |
@joshuarubin @MikeMcQuaid thank you for your continued discussion around this. I had some spare time today so I whipped-up a quick Homebrew PR to remove This is #6838. |
This change enhances the `tmux` Formula so that `utf8proc` support is an opt-in change when building `tmux`. There have been reports of rendering issues in versions of `tmux` when `utf8proc` support is enabled. Specifically these issues appear to happen when special symbols are printed, such as those commonly used in the powerline-themed status lines and shell prompts. The change to include `utf8proc` in `tmux` was in Homebrew PR Homebrew#5665. In that some PR some `tmux` users have reported issues with text being rendered in builds of `tmux`. There are also some other issues on the `tmux` tracker around similar rendering problems: * tmux/tmux#631 * tmux/tmux#632 * tmux/tmux#637 * tmux/tmux#639
This change enhances the `tmux` Formula so that `utf8proc` support is an opt-in change when building `tmux`. There have been reports of rendering issues in versions of `tmux` when `utf8proc` support is enabled. Specifically these issues appear to happen when special symbols are printed, such as those commonly used in the powerline-themed status lines and shell prompts. The change to include `utf8proc` in `tmux` was in Homebrew PR #5665. In that some PR some `tmux` users have reported issues with text being rendered in builds of `tmux`. There are also some other issues on the `tmux` tracker around similar rendering problems: * tmux/tmux#631 * tmux/tmux#632 * tmux/tmux#637 * tmux/tmux#639 Closes #6838. Signed-off-by: Mike McQuaid <[email protected]>
Just to add a final update to this issue. A change was made in #6838 to disable @joshuarubin I'll give your suggestion a go in the coming days and do some playing around with iTerm2 nightlies. Hopefully that will make things work 💯. |
brew install <formula>
(where<formula>
is the name of the formula you're submitting)?brew audit --new-formula <formula>
(after doingbrew install <formula>
)?This enables the use of utf8proc for calculating character widths. This fixes most issues with tmux on mac.
Here is the PR this originated from: tmux/tmux#524