For some reason the colours in Vim are all messed up when I use mosh. When I use ssh its working fine. When I check the terminal using mosh however, it shows the colours as 256, which is correct. Also if I execute tmux over mosh, all the colours are then correct in Vim.
I tried mosh on mintty and blink which are 2 very different clients so I suspect that is is some sort of setup issue on the machine where the server is setup rather than the client.
I've had a look through previous issues posted, but haven't found anything that could help me, or on things that could have been related (with regards to .bashrc or .profile) the things to do were not very clear. Any ideas?
when using mosh (but without tmux) what's $TERM in your inner terminal on the server, and $TERM on the outer terminal on the client?
It is xterm-256color in both. Vim seems to suggest that it is supporting 256, but the colours are displayed close to black/white/high contrast.
also: what version of mosh (on both the client and the server) ?
For one client I am using the latest version of blink (https://github.com/blinksh/blink), so I'm not sure what version that is.
For cygwin (mintty) it is 1.3.0.
On the server it is 1.3.2
Using this script as a test (since I'm not sure the best way to visually see if vim is using all 256 colors), things seems to work fine for me with 1.3.0 (mintty) on the client and 1.3.0 on the server.
I'm curious if you can reproduce the color problem with that above test script
Used the script, color looks good. They are the same on ssh and mosh, its only when I go into vim that the colors get messed up (and are correct in vim). Is it possibly something to do with what dotfiles get loaded? which would make sense because going into a tmux session through mosh and running vim, the colors are correct.
Do you have set t_Co=256 as a separate line in your vimrc?
That's the extent of my settings - I don't apply any colour settings for mosh 1.3.0, tmux 2.7, nor my terminals (gnome-terminal/iTerm2/Terminal/JuiceSSH) as they all seem to handle colours fine by default provided t_Co is set with no other custom configurations elsewhere.
Themes that I use are Tomorrow-Night-Bright and PaperColor and as far as I can tell it's more or less identical between mosh and ssh.
I just tried mosh today and ran into some symptoms described by @tB0nE...
TERM=xterm-256colors in mosh shell.:terminal buffer).mosh-1.3.2 was installed on both machines from ArchLinux package repository.
I then built mosh from the master branch with the Arch User Respository package mosh-git, and colors in neovim now work fine.
mosh 1.3.2 [build mosh-1.3.2-76-g944fd6c]
Copyright 2012 Keith Winstein <[email protected]>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Looking at the mosh --version from the master branch build, it appears there's a commit in master that fixes this.
I had the same issue, and it was because my Vim was using true (24-bit) colours, which my Mosh version (1.3.2) did not support. Setting set notermguicolors and re-applying my colourscheme fixed the issue.
Same as @HarmtH, the problem was that I had set termguicolors in my .vimrc. As soon as I commented that out - everything started working over Mosh.
It's strange that the same was not a problem over SSH, but oh well. At least the problem/solution seems to now be known.
This worked for me https://github.com/mobile-shell/mosh/issues/945#issuecomment-346627355
brew uninstall mosh
brew install --HEAD mosh
This worked for me #945 (comment)
brew uninstall mosh brew install --HEAD mosh
Funny behaviour, I happened to reinstall OS X Catalina, and when installing mosh forgot to use "--HEAD", but 256 colours were shown correctly anyway. I continued using it daily for weeks without noticing until I reboot my VPS, and the colours were all screwed up again (and tricked me into believing that I must have screwed up something on the server side...)
Most helpful comment
I had the same issue, and it was because my Vim was using true (24-bit) colours, which my Mosh version (1.3.2) did not support. Setting
set notermguicolorsand re-applying my colourscheme fixed the issue.