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

Hyper doesn't correctly handle variable-width characters #1857

Closed
2 tasks done
wyqydsyq opened this issue May 22, 2017 · 12 comments · Fixed by #4679
Closed
2 tasks done

Hyper doesn't correctly handle variable-width characters #1857

wyqydsyq opened this issue May 22, 2017 · 12 comments · Fixed by #4679
Labels
👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself

Comments

@wyqydsyq
Copy link

wyqydsyq commented May 22, 2017

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate

Issue

Hyper doesn't correctly handle variable-width characters, namely, emojis from the "noto-emoji" font. This issue is also prevalent in libvte and some Qt based terminal emulators. It works in the st emulator which apparently uses a different wcwidth implementation.

Here's a comparison between my same Tmux session looking broken in Hyper and appearing as it should in st:
image

You can also see that the spacing on the tmux pane title is messed up, strangely resizing the window sometimes fixes this unpredictably.

@wyqydsyq wyqydsyq changed the title Hyper doesn't correctly determine width of variable-width characters Hyper doesn't correctly handle variable-width characters May 22, 2017
@rauchg
Copy link
Member

rauchg commented May 22, 2017

Thanks for the report. I believe @tibotiber is currently looking into this, and his PR is very close!

@tibotiber
Copy link
Contributor

@wyqydsyq would you mind trying the code on #1536 to confirm if it fixes your issue?

@revelt
Copy link

revelt commented Jun 30, 2017

We've got a bit of a mixup: #1536 talks about more about powerline, but comments mention emoji as well. This issue is titled as to cover quite wide base, including plain emoji, but then talks specifically about emulators and issues shown are not regarding the characters but the UI of the emulator.

So, since emoji is "variable-width", it also falls into this issue, I mean things like:

hyper_unicode

I would help to test @tibotiber question above but I have no clue how to get the emulators in question set up. @wyqydsyq please follow up to Thibaut's question.

@danielniccoli
Copy link

Windows 10 version 1709, Hyper 1.4.8

Display problem with emoji's: 🎆🎆🎆🎆🎆

grafik

Notice the cursor when repeating the last command with ARROW KEY UP.

@wyqydsyq
Copy link
Author

wyqydsyq commented Jan 3, 2018

Sorry for the late reply, I stopped using Hyper due to this issue. I just tried the latest stable version which apparently has #1536 merged, however still get undesirable results. Screenshot attached shows a comparison with the display from Tilix which is how it should look.

image

@Stanzilla
Copy link
Collaborator

Should be xtermjs/xterm.js#1059

@Stanzilla Stanzilla added the 👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself label Apr 23, 2018
@Stanzilla Stanzilla reopened this Apr 23, 2018
@ghostrick
Copy link

similar problem occurred on v3.0.2

@jquast
Copy link

jquast commented Jun 8, 2020

I actually used hyper as an example in an article I wrote about varying Unicode Version level support in Terminals (and a solution that works for python), https://jeffquast.com/post/terminal_wcwidth_solution/

The gist of it is that Hyper supports only version 5.1.0 of the Unicode standard for wide characters, through its depenency on the wcwidth library, whereas version 9.0 introduces the specification of Emoji's, from the article above,

Chinese, Japanese, and Korean users, whose languages use full-width characters almost exclusively have been the most impacted by this problem, whereas the Western world only seemed to notice it with the introduction of emoticons in Unicode version 9.0.

The problem is the depenency on the wcwidth library, that library does not support any newer version. I haven't yet found a javascript version that has been brought up-to-date (Latest Unicode specification is version 13.0)

best wishes !!

@LabhanshAgrawal
Copy link
Collaborator

@wyqydsyq @jquast can you check again with the latest ci build
I ran the ucs-detect tool with the new changes and it showed UNICODE_VERSION=12.1.0; export UNICODE_VERSION

@jquast
Copy link

jquast commented Jun 24, 2020

Screen Shot 2020-06-23 at 11 18 30 PM

Everything looks great now, thanks

@LabhanshAgrawal
Copy link
Collaborator

Screen Shot 2020-06-23 at 11 18 30 PM

Everything looks great now, thanks

What is this tool you're using?

@jquast
Copy link

jquast commented Jun 24, 2020

pip install wcwidth blessed

then, this is the script: https://github.com/jquast/wcwidth/blob/master/bin/wcwidth-browser.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants