rpwoodbu / mosh-chrome

Mosh for Chrome
GNU General Public License v3.0
371 stars 59 forks source link

issue with 256 colors #111

Open tnguyen14 opened 8 years ago

tnguyen14 commented 8 years ago

I followed the instructions on the Secure Shell FAQ page to set up the right terminal, but I don't think I have 256 colors configured/ working right.

Running the color test here https://github.com/chriskempson/base16-shell#troubleshooting, I see all the dark blue colors.

Running ls -al on a directory does not print out colors and bolds the way it's supposed to.

I am not sure what I might be doing wrong here. Would anyone have any suggestions/ advice?

frizop commented 8 years ago

I've had decent luck just launching a terminal that was already doing 256-colors http://imgur.com/4UGI1Ip

ttelford commented 7 years ago

It's not a problem with mosh-chrome, as far as I can tell.


Under mosh server command use:

mosh-server new -c 256

The -c option tells mosh-server to use x colors; 256 in our case.

It would be nice is if there were a configuration preference to do this; but for now, being able to edit the mosh server command box works too.

rpwoodbu commented 7 years ago

The default command includes -c 256, but definitely if you're overriding the command, you'll need to be sure to specify that switch.

gordallott commented 7 years ago

for what it is worth, this terminal does support 256colors (as shown by 256colors.pl). the terminal does not support settings the colors 17-21 which is why the bottom colors show up blue in the base16 color test

screenshot 2017-07-30 at 19 33 29

indeed normally base16 is able to change your color-scheme on the fly with the base16_* commands (I'm personally a fan of setting different machines to have different colour schemes this way) but it is unable to. which suggests that whatever base16 does to set the default terminal colours to 256 colours is what does not work at all.

rpwoodbu commented 7 years ago

@gordallott Is this reproducible in the Secure Shell app? May be an hterm problem.

gordallott commented 7 years ago

Secure Shell handles it properly

screenshot 2017-07-31 at 09 25 25

allows me to change colour schemes on the fly with base16 commands also

rpwoodbu commented 7 years ago

@gordallott I just tried to repro this, and I don't see this working in Secure Shell (v0.8.36.8)... in other words, I see blue lines instead of gray. I connected directly to a machine and ran colortest; I did not jump through mosh, tmux, screen, etc. So this would suggest that the problem is with hterm.

I'm curious as to why it'd be working for you. What version of Secure Shell are you running?

gordallott commented 7 years ago

using the same Secure Shell version here (0.8.36.8), note in order to install base16 properly to test this you will want to set a color theme as well as set the bashrc details. if you run base16_railscasts in secure shell it should change the terminal colour scheme and running colortest should produce the correct results

cgull commented 7 years ago

The core Mosh code doesn't support the escape sequences for changing base colors, so Base16 is not going to work there or in mosh-chrome. We ran into this issue before, see http://mailman.mit.edu/pipermail/mosh-users/2016-June/000323.html for a bit more discussion. Please open an issue at https://github.com/mobile-shell/mosh if this is something you want fixed.

@rpwoodbu, do you know if hterm supports these obscure escape sequences?

vapier commented 6 years ago

i've never heard of base16 before. but iiuc, the escape sequences we're talking about:

hterm supports all of those: https://chromium.googlesource.com/apps/libapps/+/HEAD/hterm/doc/ControlSequences.md

running that base16 code seems to work fine under Secure Shell. note that you can't just clone the repo and run ./colortest, you have to first select a profile. the last few colors are dark blue by default which is why you see that (correct) behavior. so instead try doing:

$ git clone https://github.com/chriskempson/base16-shell
$ cd base16-shell
$ ./colortest
<last few colors should be dark blue>
$ eval "$(. ./profile_helper.sh)"
$ base16_github
$ ./colortest
<see how the last few colors have now changed>
jmburges commented 3 years ago

I think I'm getting a similar problem. My vim (with Solarized theme) is giving weird colors. When I load vim I get this Screenshot 2021-05-12 05 42 32

my $TERM is set to xterm-256colors and this works perfectly with regular SSH through the chrome ssh app. I've tried with the mosh-server in the Ubuntu repo as well as the latest from the master branch.

vapier commented 3 years ago

i think 256-colors are working in mosh now. the problem originally reported here was about color palette changing. afaict, mosh still doesn't support OSC-4 (among many others). so these bugs need reporting to upstream mosh. https://github.com/mobile-shell/mosh/blob/756f4f8e987060e6e67aea788e545557146c5716/src/terminal/terminalfunctions.cc#L591-L627