blinksh / blink

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

Support for setting colours from escape sequences? #540

Open codybuell opened 6 years ago

codybuell commented 6 years ago

Apologies if this has been discussed elsewhere but my searches are coming up empty. It appears base16-shell is not able to change blink’s theme colours with escape sequences. Any chance of supporting this?

mklnz commented 6 years ago

I'd like to know this also, been having a lot of color problems in Blink, where as I have everything set up correctly using base16 on macOS iTerm2

mike-hearn commented 5 years ago

Apologies, but I'd like to bump this thread. I also use base16 and the lack of escape sequence support really breaks blink. Running base16-shell's color test, it looks like this:

img_5e9dac160186-1

When it should look like this:

image

The last six lines are blue in Blink, while they're the proper custom shades in my desktop terminal (kitty, but iTerm etc also render it correctly).

Is it possible to get support for this in blink? Without it, it makes blink pretty unusable since it turns large swaths of my terminal programs some shade of blue.

katmfoo commented 4 years ago

This is also something I would love to see

mike-hearn commented 4 years ago

In the current version of blink this actually works.

If I recall, the thing that was blocking it was an old version of mosh that didn't support it, but blink updated to the HEAD version of mosh some time back and it resolved this issue.

katmfoo commented 4 years ago

@mike-hearn I can confirm that the latest version of blink on the app store still has this issue. Is this fix not released yet?

mike-hearn commented 4 years ago

Hmm, strange. This wasn't a recent development AFAIK, I've been using blink with base16 for a few months (at a minimum - it's possible it's been more than a year). I just re-ran colortest to confirm I'm not crazy and I'm seeing colors 17-21 correctly replaced properly. There must be something different between our environments. 🤔

yury commented 4 years ago

I see blue lines in my setup :(.

mike-hearn commented 4 years ago

OH! On your server you may also have to compile & install mosh from the HEAD commit. If you don't do it manually, most package managers will install the most recent official release, which is 1.3.2 from 2017. Since then a ton of things have been fixed, including the color issue.

yury commented 4 years ago

@mike-hearn I’m trying with ssh.

Can you share your env vars (TERM and TERMCOLORS) ?

katmfoo commented 4 years ago

@mike-hearn Does it work for you over ssh? I wasn't able to get it working on either ssh or mosh, but maybe it will work if I use the latest available mosh from the HEAD commit. I will have to try that.

Edit: I tried with the HEAD version of mosh on the server, still not working. @mike-hearn, is it possible it has anything to do with tmux? Also would be interested in your env vars

Edit 2: Using HEAD version of mosh server on the server, I am getting base16 working over mosh when using iterm2 on macos (mosh client version 1.3.2, same as whats on blink shell), but it does not work from blink shell (on the same exact server). I do not have base16 shell setup locally on macos, so it is definitely working over mosh at least, just not when using mosh from blink shell.

yury commented 4 years ago

2AE78D74-DC94-497D-902A-C12B232D8DC7

@mike-hearn will be fixed in next version for ssh. Mosh doesn’t support OSC 4 code... I will look.

katmfoo commented 4 years ago

@yury On the latest testflight build and with mosh head installed on server, the colors themselves work fine, but only update when you login to the server for the first time. So typing a base16 alias command won’t make the change, but re logging in with mosh will make the change happen.

EDIT: Actually, it seems like the background color of the shell doesn’t get set for mosh connections

katmfoo commented 4 years ago

@yury Any update on this? Is this just a limitation of mosh, that it doesn't support OSC 4 to change the colors? base16-shell works perfectly over SSH. A work around I use with other terminal emulators is to just SSH into the server so the terminals colors get set, and then exit and MOSH in to enjoy the colors. This work around doesn't seem to work entirely with blink though, the background color seems to change.

For example, if I am SSHed into my server and have a base16 color theme with a light background, if I exit and MOSH into the same server, all the colors seem to stay the same except the background is now dark.