blinksh / blink

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

True colours over Mosh connection #231

Closed jamiedumont closed 7 years ago

jamiedumont commented 7 years ago

Hi - before we start - loving Blink!

That said, I've been having some issues with the display of colours inside Neovim (using True Colours) when connecting to my server via Mosh.

Connecting over SSH sees all the colours render as they should, however Mosh is all over the place (almost inverted, and totally illegible, rather than just a bit 'off').

I understand that Mosh itself doesn't support true colours, but a comment in issue #2 seemed to imply that this could be worked around within the terminal as per iTerm's implementation. Has that work around been built yet, or have I found an edge case?

If I can provide any more details to help explain this, please just ask! Cheers.

carloscabanero commented 7 years ago

Hi Jamie! So that is correct and there is nothing we can do with Mosh not supporting TrueColor. What the iTerm guys suggest in this case is to basically configure the theme, as you can just use any color you want in there. So the color comes from the theme instead of from the application.

The weird part is that you ssh can render everything correctly, but not with Mosh. There might be something going on there. Would you mind to send me the colors or the theme you are using to take a better look at it? I'm assuming that Mosh on desktop renders just fine, correct?

Thanks!

jamiedumont commented 7 years ago

I'm using the included Solarized theme for Blink, and OceanicNext for Neovim.

What the iTerm guys suggest in this case is to basically configure the theme, as you can just use any color you want in there. So the color comes from the theme instead of from the application.

Just so I understand, you mean configure my own Blink theme to adjust the colours that are being used?

SSH is fine on both desktop (iTerm) and Blink. However, I hadn't thought to try iTerm and Mosh, but that also has the same issues. I had assumed that it would have been fine based on the "workaround" comment. You know what they say about assumptions...

So, just to clarify, if I play with the colour values of the theme (either iTerm or Blink), I should be able to recreate an approximation of the correct ones?

carloscabanero commented 7 years ago

Yes, for example that's what I do with my Monokai dark themes. Define the colors from the terminal so that you get to use any you need, and then just let the terminal use the ones they have to. With neovim the problem is that they define a lot more combinations than the normal 16, so you will still be disappointed.

In any case, it is weird that it doesn't work in Mosh but it does with SSH. It might be a problem with the way Mosh is encoding the values for true color. Would you mind checking what iTerm or Terminal.app do? Also, I saw the theme has an option to just use 256 colors, maybe that does the trick and the approx. is good enough.

jamiedumont commented 7 years ago

img_0003 img_0004

That's the difference I'm getting between Mosh (top) and SSH (bottom), even after creating a theme for Blink.

As you say, falling back to the 256 option within the theme may be my best bet. Worth it to avoid SSH lag!!!

carloscabanero commented 7 years ago

@jamiedumont closing here as we cannot fix it from our side. We will reopen once it is possible.

wookayin commented 7 years ago

A correct reference: mobile-shell/mosh#649

carlosvigil commented 6 years ago

Is possible now đź‘Ť

sethyuan commented 6 years ago

Any follow ups with the issue? Basically, mosh and neovim can't be used together in the current state.

bchallenor commented 6 years ago

I don't think there is a Mosh release with the 24-bit color patch yet. I opened an issue about it.

drewcovi commented 5 years ago

Can this be reopened? The 24 bit support does exist on keithw’s ppa.

https://github.com/mobile-shell/mosh/issues/649

softinio commented 5 years ago

@drewcovi whats Keithw's ppa?

I thought this fix on server side still not included in an official release.

Be good to compile it into blink though which I think is what you are referring to as the server side we can install via cloning master and building to get the support.

@carloscabanero what u think?

softinio commented 5 years ago

Ref: https://github.com/mobile-shell/mosh/issues/945

sbromberger commented 5 years ago

It's possible to install a mosh-server with 24-bit color support. This works with unix-based mosh clients. However, blink still does not support 24-bit color via mosh (works via ssh, though). It'd be great to have, since (as discussed above) vim doesn't work properly without it.

(interestingly enough, tmux inside blink's mosh DOES seem to support 24-bit color.)

yury commented 5 years ago

@stephenhouser can you provide screenshots, so I can test with them?

sbromberger commented 5 years ago

@yury - if you're looking for a way to see whether 24-bit color is supported, just use this script.

drewcovi commented 5 years ago

@softinio for clarification:

https://launchpad.net/~keithw/+archive/ubuntu/mosh

drewcovi commented 5 years ago

Obviously that’s for the server side. Not sure where to go to get client side.

sbromberger commented 5 years ago

@drewcovi: also ref https://github.com/mobile-shell/mosh/issues/945#issuecomment-346627355 (OSX mosh-server instructions)

drewcovi commented 5 years ago

Sorry. It’s late on Friday. Obviously just grabbing from master would be the best bet 🙄 https://github.com/mobile-shell/mosh/commit/6cfa4aef598146cfbde7f7a4a83438c3769a2835

drewcovi commented 5 years ago

I can’t say why they’re waiting forever to cut a release.

carloscabanero commented 5 years ago

They were doing a lot of work on their side, and I don’t think we should take from any point in master. Will ask.

drewcovi commented 5 years ago

@carloscabanero were you able to follow-up on this? Seems the mosh product is losing some steam and is long overdue for a new release... I've been running an early release on Ubuntu Server and Mac without issue.

norcalli commented 5 years ago

@carloscabanero can we add it as mosh-master or mosh-experimental or something? That way the distinction is obvious and people will know it's experimental, and a second binary doesn't break existing solutions. I seriously need this feature because my current setup assumes true color, and it's kind of difficult to change back now.

Also, I've been using mosh master for 3 years without issue, professionally and personally every single day. I keep finding myself looking for an alternate app that does have this because at this point it's infuriating (esp because of how much I love Blink otherwise).

carloscabanero commented 5 years ago

Hi @norcalli! Our just released 12.9 pushes from master. Let us know if you have any issues.

norcalli commented 5 years ago

@carloscabanero sorry for the late reply, I was travelling. what timing! It works! finally!

carloscabanero commented 5 years ago

Great news!! Do you have any cool screenshots showing up true color? I would love to tweet them!

norcalli commented 5 years ago

@carloscabanero the only cool thing I have is Neovim inside tmux with true colors that isn’t illegible IMG_0041

termguicolors is the flag which indicates to use true colors.

ipetkovic commented 5 years ago

Is this fix available on iOS app? I am interested to buy it, but only if true color is supported.

yury commented 5 years ago

@ipetkovic yep, it is supported. But you have to server build from the master. See details

ipetkovic commented 5 years ago

Thanks, will try it out then ;-)