[mosh-users] Mosh, clusterssh and colors

John Hood cgull at glup.org
Tue Jun 7 22:56:59 EDT 2016


On 06/07/2016 14:56, Niklaas Baudet von Gersdorff wrote:
> Hello Keith,
>
> thanks for your reply.
>
> Keith Winstein [2016-06-07 10:24 -0700] :
>
>> (1) Does mosh work properly by itself (forgetting clusterssh for the
>> moment)?
> I does so perfectly. I use it for my everyday work on the same server
> with the same set-up without any problems.
>
> Also, I don't get wrong colors with ssh+clusterssh. I only get wrong
> colors with mosh+clusterssh. I might be wrong but that made me suspect
> that it's related with mosh (and not something else).
The base16 scripts rely on an obscure XTerm feature-- the OSC
change-color commands.  Mosh doesn't support those commands, or pass
them through.

My best guess is that you have a base16 script set up in your shell
profile/login scripts on both client and server.  When you use plain
ssh, everything is fine, because base16 runs both when you start the
client XTerm and when you login to the remote server.  When you use
plain Mosh, everything is fine-- because base16 runs when you start the
client XTerm, and the base16 invocation on the server is essentially
discarded by Mosh.  When you use cssh with ssh, everything is fine--
cssh starts an XTerm invoking ssh and base16 does not get run there, but
the remote server runs base16 and it's passed through to the XTerm. 
When you use cssh with mosh, it breaks-- base16 is not run locally on
the new XTerm and the server's invocation is discarded.

Unfortunately, implementing this feature is going to be pretty low on
the priority list-- you're the first person to run into this issue that
I know of.  A possible workaround is to write a wrapper script that
invokes the base16 script, then runs mosh.  Use that as the ssh command
in your .clusterssh/config file.  That way, when cssh starts the XTerm,
the base16 script is always run locally.  You might even find benefit in
doing this for ssh, ignoring mosh.

You could also investigate XTerm's XTerm.vt100.color* resources,
documented in the man page, which appear to have the needed
functionality.  X resources are horribly archaic, but they should work
reliably for any XTerm you start without requiring any scripting.

Regards,

  --jh



More information about the mosh-users mailing list