Skip to content

vim syntax highlighting fails inside tmux #557

Closed

Description

@berceanu

Steps reproduce:
connect to another machine using mosh
launch a tmux session
open a code file in vim
Result: syntax highlighting is almost completely lost
The same steps with ssh instead of mosh do not change the vim colors in any way.
mosh screenshot:
mosh
ssh screenshot:
ssh

Activity

  1. eminence commented on Oct 15, 2014

    @eminence
    Member

    What happens if you run :syn on within vim? Do the colors then appear?

  2. berceanu commented on Oct 16, 2014

    @berceanu
    Author

    nope. syntax highlighting is on, in fact. if you look carefully at the first pic, there is a difference in color between "module" and "MyModule".

  3. vdrandom commented on Oct 16, 2014

    @vdrandom

    I think it has something to do with #178 , check you $TERM values locally and after you connect to the remote host.

  4. blittle commented on Dec 17, 2014

    @blittle

    ssh
    screen shot 2014-12-17 at 1 44 38 pm

    mosh
    screen shot 2014-12-17 at 1 44 26 pm

    When using mosh with tmux and vim, I get really random and weird background color shifting. As you can see in the second screenshot for some reason there is weird highlighting in between the json attributes and on the "24"

    Inside tmux/mosh and tmux/ssh my $TERM is screen-256color. Over just ssh and mosh the $TERM is xterm-256color. On my local machine $TERM is xterm-256color. So tmux seems to be changing the $TERM but ssh doesn't seem to care while mosh does.

  5. keithw commented on Dec 17, 2014

    @keithw
    Member

    What version of mosh-client are you running on the client, and what version of mosh-server on the server?

  6. blittle commented on Dec 17, 2014

    @blittle

    That probably has something to do with it:

    server

    $ mosh --version
    mosh 1.1.3
    

    and
    client

    $ mosh --version
    mosh 1.2.4
    
  7. blittle commented on Dec 17, 2014

    @blittle

    @keithw that did it for me things seem to be working when updated my version of mosh on the server, thanks and sorry for the rabbit hole :)

  8. keithw commented on Dec 17, 2014

    @keithw
    Member

    Not sure which is the client and which is the server, but versions of mosh before 1.2 had pedantic/sophisticated colorimetry code that posterized 256-color colors to the perceptually-closest 8-color color for terminals that did not advertise their ability to support 256-color escape sequences (I am not making this up).

    In Mosh 1.2, we went to a much simpler approach where we pass through the 256-color escape sequences even if the terminal doesn't advertise support. This is less pedantically correct but in practice produces better results. Glad to hear that upgrading helped.

    @berceanu, was this also your issue?

  9. cgull commented on Jun 6, 2015

    @cgull
    Member

    No response from original reporter. See also #507.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions