<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi John,
<div><br>
</div>
<div>Overriding the TERM variable for mosh is very&nbsp;detrimental, as mosh implements only xterm and xterm-256color terminfo.</div>
<div><br>
</div>
<div>It seems a better solution for your problem is to check for the existence $SSH_* variables (SSH_CONNECTION, etc) and set up your tmux to not ssh further if they are present. This will work even with mosh, as mosh leaves the SSH variables set from the initial
 connection used to bootstrap the mosh connection.</div>
<div><br>
</div>
<div>Sincerely,</div>
<div>-Alex</div>
<div>mosh packager for Fedora<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF713358" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>From:</b> mosh-devel-bounces@MIT.EDU [mosh-devel-bounces@MIT.EDU] on behalf of John Terenzio [john@terenz.io]<br>
<b>Sent:</b> Monday, June 18, 2012 10:47 AM<br>
<b>To:</b> mosh-devel@mit.edu<br>
<b>Subject:</b> [mosh-devel] $TERM Environment Variable<br>
</font><br>
</div>
<div></div>
<div>Hi,
<div><br>
</div>
<div>I've been enjoying using Mosh but I have a small issue with the $TERM variable. My use case is that I run Tmux locally, then inside that session I connect to another server with Mosh. Before, when I used SSH, my $TERM variable from inside Tmux (&quot;screen-256color&quot;)
 would get forwarded to the remote host. I have my computers set up so that Tmux starts automatically if the $TERM variable does not start with &quot;screen&quot;. With SSH, nothing would happen on the remote host, but with Mosh I'll get nested Tmux sessions because
 the remote host doesn't know it's already inside Tmux (it sees &quot;xterm-256color&quot;).</div>
<div><br>
</div>
<div>I patched my copy of Mosh by removing the lines that set the $TERM variable, which make it just inherit the current one (diff attached). This works for me and I don't see a downside to it, but I also thought about adding a command line switch to override
 the $TERM variable if what I did isn't robust enough. If you tell me your thoughts on fixing it I'm happy to submit a pull request.</div>
<div><br>
</div>
<div>Thanks!</div>
<div>John</div>
</div>
</div>
</div>
</div>
</body>
</html>