[mosh-devel] Is there a way to tell if you are running inside mosh?

Alex Chernyakhovsky achernya at mit.edu
Thu Nov 15 09:35:40 EST 2018


Hi,

What's the value of $TERM in the terminal emulator where you are
running ssh/mosh? It looks to me like you may be using color codes
that are not (claimed to be) supported by the outside terminal
emulator and mosh is compensating.

Sincerely,
-Alex
On Thu, Nov 15, 2018 at 6:56 AM TJ Luoma <luomat at gmail.com> wrote:
>
> Hi folks
>
> I just installed mosh after hearing about it for awhile but never
> having used it before. I'm not sure if this is the best place to ask
> questions. If not, please let me know. I checked the IRC channel but
> it seemed to be empty.
>
> I have a rather complex zsh prompt which uses colors using ANSI color
> codes… to be honest, I just copied it from some website several years
> ago, and I don't even understand how it works myself.
>
> When I connect via ssh, it works fine. When I connect via mosh, it
> looks weird. Here's a picture, showing SSH on top, and MOSH on bottom:
>
> https://www.dropbox.com/s/y1xuktzuom648f8/ssh-on-top-mosh-on-bottom.png?dl=0
>
> Ideally, I'd like to figure out how to make this work under MOSH, but
> in the meantime I'd like to setup my .zshrc to use a different prompt
> when I am connected via MOSH instead of SSH.
>
> However, I can't seem to figure out how to tell the difference
> programmatically. The only thing I knew to try to check was `printenv`
> but that didn't show me anything, at least as far as I can tell.
>
> Thanks for any pointers
>
> TjL
>
>
> --
> TJ Luoma
> TJ @ MacStories
> Personal Website: luo.ma (aka RhymesWithDiploma.com)
> Twitter: @tjluoma
>
> _______________________________________________
> mosh-devel mailing list
> mosh-devel at mit.edu
> http://mailman.mit.edu/mailman/listinfo/mosh-devel



More information about the mosh-devel mailing list