Re: Making mosh work

4533 views
Skip to first unread message

Dean Beeler

unread,
Dec 11, 2012, 6:40:31 PM12/11/12
to is...@googlegroups.com
Mosh pulls whatever you have set for non-interactive logins in bash. .bashrc and the encoding are for interactive sessions only.

I'm trying to find a good walkthrough that explains how this is resolved on different systems. I'll post some more info in a few.

Dean

On Tuesday, December 11, 2012 3:27:58 PM UTC-8, Alan S wrote:
So I've bought the in-app mosh support, and configured one of my connections (to a linux server) to use mosh and the UTF-8 encoding on issh.

On the server, the locale of my account is en_US.UTF-8 (LC_ALL=en_US.UTF-8) and works fine when I mosh from the server to itself.

Using issh, I get:

Mosh reported: mosh-server needs a UTF-8 native locale to run.
Unfortunately, the local environment ([no charset variables]) specifies the character set "US-ASCII".
The client-supplied environment ([no charset variables]) specifies the character set "US-ASCII".

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
etc. all POSIX
LC_ALL=

Why isn't issh presenting a UTF-8 locale when it's configured to do so apparently? Help. :)

 - Alan

Stuart Levine

unread,
Dec 11, 2012, 7:48:42 PM12/11/12
to is...@googlegroups.com
Dean,

Interesting point, but I though the error might be with iSSH since the server stated the client-supplied-environment, in this case iSSH, specifies the character set "US-ASCII" and shows the LANG ENV variable as null when connecting to the mosh server.  I'd be very interested in what you post as resolution to this issue.  I'm using zsh btw, not bash as my shell.

Thanks,

Stuart

Alan S

unread,
Dec 11, 2012, 9:30:53 PM12/11/12
to is...@googlegroups.com
Note further that I have mosh working fine when using the linux client with the same server, which suggests to me it's a client (issh) issue, not server or account setup.

Dean Beeler

unread,
Dec 11, 2012, 9:34:26 PM12/11/12
to is...@googlegroups.com
Right. I realize now that the official mosh client probably starts its sessions interactively while I'm starting them non-interactively. As I couldn't replicate this issue for myself beta testers were able to solve it by changing (or setting a locale) for their non-interactive sessions.
 
Either way it should be a simple fix.

Dean

Alan S

unread,
Dec 11, 2012, 10:07:11 PM12/11/12
to is...@googlegroups.com
Yes, that fixes. Thanks!

stuart

unread,
Dec 12, 2012, 6:59:59 AM12/12/12
to is...@googlegroups.com
Dean,

Did some research this morning and found a solution for non-interactive configuration of necessary ENV variables.  It seems, most systems have an "/etc/environment" file and this is where I added the following:

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

After saving the file, my connection with iSSH to the mosh server was successful!  The real question in my mind now, is: what if you don't have root access to change this file in /etc?  Can you save a local ".environment" file in your home directory to make this work?  Or, do you just add it to your .profile?  I have not tested either solution since I have root access on my server and was able to change the /etc/environment file.

Hope that helps others who have reported the same issue

Stuart

Alan S

unread,
Dec 12, 2012, 9:14:12 AM12/12/12
to is...@googlegroups.com
.bashrc was my workaround as well, using LC_ALL.

Jason White

unread,
Dec 12, 2012, 10:56:00 AM12/12/12
to is...@googlegroups.com
On Wednesday, December 12, 2012 at 8:14 AM, Alan S wrote:
.bashrc was my workaround as well, using LC_ALL.
Similarly, if you're using csh/tcsh you can add the following to your .cshrc/.tcshrc:

  setenv LC_ALL en_US.UTF-8

Just make sure it's not inside a block that only gets called during an interactive login.

-Jason

-- 
Jason White <jdw...@menelos.com>

Zane Revai

unread,
Jan 4, 2013, 11:24:14 AM1/4/13
to is...@googlegroups.com
Thanks a bunch. The Path setting worked for me. Perhaps add it to the in app help or the iSSH FAQ??
I was able to connect after entering the following into the Path configuration box for my current connection in iSSH:

LANG=en_US.UTF-8 mosh-server

This is by far the easiest fix compared to .bashrc, etc… this makes iSSH work without changing anything server side. I used the default MacPorts install of Mosh v1.2.3 and the above setting in iSSH and it just worked, both on local network and over Internet from another location.
Reply all
Reply to author
Forward
0 new messages