Get french accent on Linux terminal connected via ssh from MacOS High Sierra

bashinternationalizationkeyboardterminal

I come on this forum since no answers or suggestions on other forums.

I am often connecting from a MacOS High Sierra terminal via SSH to a Debian 8.0.
The locales on my MacOS are :

LANG=
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

Everything on MacOS side works fine, I can type on this MacOS terminal all french characters, even combined for example to get "ê" character with key "^+e".

My issue is that I am often connected via to a Debian 8.0 and I can't get to have french accents like I have on MacOS.

I have done on Debian 8.0 :

# locale-gen 
Generating locales (this might take a while)...
  fr_FR.ISO-8859-1... done
  fr_FR.UTF-8... done
  fr_FR.ISO-8859-15@euro... done

So the locales on Debian 8.0 are :

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="fr_FR.ISO8859"
LC_NUMERIC="fr_FR.ISO8859"
LC_TIME="fr_FR.ISO8859"
LC_COLLATE="fr_FR.ISO8859"
LC_MONETARY="fr_FR.ISO8859"
LC_MESSAGES="fr_FR.ISO8859"
LC_PAPER="fr_FR.ISO8859"
LC_NAME="fr_FR.ISO8859"
LC_ADDRESS="fr_FR.ISO8859"
LC_TELEPHONE="fr_FR.ISO8859"
LC_MEASUREMENT="fr_FR.ISO8859"
LC_IDENTIFICATION="fr_FR.ISO8859"
LC_ALL=fr_FR.ISO8859

I have also tried with :

# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fr_FR@euro
LANGUAGE=en_US.UTF-8
LC_CTYPE="fr_FR.ISO8859"
LC_NUMERIC="fr_FR.ISO8859"
LC_TIME="fr_FR.ISO8859"
LC_COLLATE="fr_FR.ISO8859"
LC_MONETARY="fr_FR.ISO8859"
LC_MESSAGES="fr_FR.ISO8859"
LC_PAPER="fr_FR.ISO8859"
LC_NAME="fr_FR.ISO8859"
LC_ADDRESS="fr_FR.ISO8859"
LC_TELEPHONE="fr_FR.ISO8859"
LC_MEASUREMENT="fr_FR.ISO8859"
LC_IDENTIFICATION="fr_FR.ISO8859"
LC_ALL=fr_FR.ISO8859

I don't see where is the problem, anyone could help me to have french accent on Debian terminal from my MacOS keyboard like I have on my MacOS terminal ?

UPDATE 1 :

I tried the solution suggested by @Spiff by doing :

 $ locale-gen "en_US.UTF-8"
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.

$ locale 
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

But this doesn't seem to work since when I type on french accent character, nothing displays.

UPDATE 2 :

I have found a partial solution : if I put into a new file ~/.bash_profile :

LANGUAGE="en_US.UTF-8"

Then, I can type french accent characters.

But now, the issue is that I have no more the file ~/.bashrc executed (so no more environments variables, no alias, nothing more).

If I do at the end of ~/.bash_profile : source ~/.bashrc, nothing happens.

How to circumvent this issue and make take into account my ~/.bashrc file ?

Best Answer

SOLUTION : uncomment in /etc/ssh/sshd_config :

# Allow client to pass locale environment variables
#AcceptEnv LANG LC_*

(made community wiki; credit to OP)