I’m assuming that command behaves differently than the one you ran. Maybe you can figure out why. I’m guessing that the -n and/or -tt interacts with your personal dotfiles somehow—it’s not uncommon for dotfiles to include conditional tests such as [ -t 1 ].

Unfortunately, there is by default no way (as far as I can tell) for a normal user to set $BASH_ENV for a non-interactive non-login shell invoked over SSH; environment variables defined in ~/.ssh/rc don't seem to get exported to the shell, and ~/.ssh/environment is not used under the default OpenSSH settings.

Is there a way to instruct mosh not to pass the -tt option to ssh? If it didn't, would that break mosh-server?

Aha, that’s what I’d forgotten about. I think you now have a correct diagnosis here.

Note that the shell that would later spawned by mosh-server is a login shell that reads all the standard dotfiles, so if you just pass mosh --server=/inside/home/anovak/.local/bin/mosh-server localhost, things should work.

The -tt was added in #378. It’s possible we may want to replace that with some other strategy, due to this and perhaps #464.