Really fix locale errors on an ssh connection from OSX

This is a follow-up for the previous Fix locale errors on an ssh connection from OSX.

Basically, after applying my previous fix, I was still having issues with my ssh console. Most obvious symptom was a wrongly positioned cursor (which was the least annoying one):
Ubuntu: cursor badly positioned

I'm using Ubuntu, Fedora server is long gone, but I'm guessing solution is similar.

After some googling and some trial and error, I did two things:

  1. Disable "Set locale environment variables on startup" on my OSX terminal
  2. Set default locale in Ubuntu

Disable "Set locale environment variables on startup" on my OSX terminal

DO NOT DO THIS! See update 2015 11 07 A below.
OS X Terminal advanced settings

Set default locale in Ubuntu

nano /etc/default/locale

 # This is how mine looks like:
 LANG="en_US.UTF-8"
 LANGUAGE="en_US:"
 LC_ALL="en_US.UTF-8" # See update 2015-11-07-B

Make sure you have the locale you set in LANG installed.

After that, you could actually uncomment the line commented in my previous solution, and thing would still work (although I would still leave it commented, just because it doesn't hurt).


Updates

  • 2015 11 07 A:
    Un-checking "Set locale environment variables on startup" has a nasty side effect when opening applications from the command line. I noticed that within Sublime, $PATH variable was not being captured. This had the effect that when working with virtual-envs in python, bins from that virtual-env would not be found.
  • 2015 11 07 B:
    Because of the previous change, el problema came back, and the solution was to also set LC_ALL in Ubuntu.
Oct. 1, 2015

Comments