blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.18k stars 576 forks source link

Broken unicode subscripts, unusable mosh #524

Open goerz opened 6 years ago

goerz commented 6 years ago

I'm having problems with the rendering of unicode subscripts in all fonts.

Consider the following screenshot in Fira Code:

img_0219

The cursor is on top of a letter that's supposed to be a subscript-t, but a placeholder is shown instead. For Menlo: img_0220

Pragmata actually works (but I find its ultra-condensed letters a bit hard to get used to): img_0221

Roboto is broken again: img_0222

...as well as my preferred Source Code Pro: img_0223

... and Courier: img_0224

It would be good if all the default fonts in Blink had a very complete set of unicode characters. Also, I think these symbols used to work for with Source Code Pro, and they definitely work with Source Code Pro on the Mac in iTerm.

All of the above rendering problems are while being connected via ssh. If I connect via mosh, these charactes cause severe rendering problems that make Blink unusable. For Courier:

img_0226

After manually forcing a screen-redraw with CTRL-L, the screen looks like this: img_0225

It looks ok at first glance, but the characters that can't be drawn are actually missing, and it really confuses vim (it still sees them, as indicated by me showing the character information for the position under the cursor).

I have similar problems with all other fonts. This includes Pragmata, which worked correctly with ssh, but not with mosh:

img_0227

The file that I'm editing in these screenshots is https://github.com/mabuchilab/QNET/blob/6f876e865aa6488c21499f441e44a97c435720d8/src/qnet/printing/_unicode_mappings.py

yury commented 6 years ago

Hi @goerz,

Thank you for your feedback. Will try to fix that before our dot fix release.

yury commented 6 years ago

this is iOS 11, right?

yury commented 6 years ago

Hi @goerz,

It would be good if all the default fonts in Blink had a very complete set of unicode characters.

Not all fonts have complete glyphs, most powerful and complete is PragmataPro, but because of that it is a little bit slow.

Also, I think these symbols used to work for with Source Code Pro,

Nope, turns out all our fonts (except PragmataPro) don't have that glyphs.

and they definitely work with Source Code Pro on the Mac in iTerm.

Source Code Pro has only 970 glyphs. So iTerm as Terminal.app do fallback. If you have installed Powerline fonts it could fallback to Arimo.

Blink falls back to Menlo, and Menlo contains only 2715 glyphs. So after some researching and comparing fonts, I found DejaVu Sans Mono. It has 3296 glyphs and look very similar to Menlo (except ligas, which we have to disable #511).

screen shot 2018-06-06 at 12 24 05 pm screen shot 2018-06-06 at 12 24 20 pm

So for ssh part we will be good with next release: img_53b00791f156-1

Looking on mosh part...

yury commented 6 years ago

Bad news for mosh part.

Just tested in iTerm 2, Terminal.app and Blink. All iTerm 2:

screen shot 2018-06-06 at 1 05 11 pm

Terminal.app:

screen shot 2018-06-06 at 1 05 03 pm

Blink: img_e9c778dca3cc-1

I think this mosh issue is related to this: mobile-shell/mosh#909. And they are working to fix that mobile-shell/mosh#949.

goerz commented 6 years ago

Thanks for looking into this! Having DejaVu Sans Mono has a fallback would be great. I kinda forgot that I have powerline-patched fonts on the Mac (I think; it's something that I did years ago and never touched again since). Also, I didn't actually test mosh on the Mac (while I like the idea of mosh, I find that is has a lot of these kinds of bugs, so I avoid it unless I have a truly bad network connection, like on a train going through tunnels)

yury commented 6 years ago

Hi @goerz, we pushed 11.8 (1) to TF.

goerz commented 6 years ago

Looks good! (on ssh)

mosiman commented 5 years ago

Hey, can this issue be re-opened? I’m coming from Termius because their update just broke their right shift key, and I’ve heard the greatest things about Blink. But I can’t even use Blink for the one and only purpose I bought it for, Mosh, since Unicode subscripts are broken. They do work on SSH, but that’s not why I spent 27.99 CAD on it.

Can we re-open the issue? I program in Julia and without proper Unicode support, Blink is basically useless. I also see that #949 is still open two years later.

yury commented 5 years ago

Hi @mosiman,

Sure I will reopen that issue. Please send file examples that do not work to you. Also please tell me what server and locale do you use.

mosiman commented 5 years ago

Hi @yury ,

Here is an example file that I think shows what the problem is. https://gist.github.com/mosiman/2ce7100f04ef83831f619e06defa4126

Using SSH: image

Using Mosh: image

Some subscripts appear, but not all.

Here is my locale:

image

This is on a debian server.

I've tried most of the fonts provided to no avail, but I don't think it's a font issue as they display just fine in SSH.

Hope this helps. Let me know if there is anything else I can provide.