Subject: Bug#282: Use client-side LANG + LC_* settings in server session

From: Mike Gabriel <[email-masked]>
Date: Fri, 02 Aug 2013 09:39:04 +0200

Package: x2goclient
Severity: wishlist
Version: 4.0.1.0
X-Debbugs-CC: Kromitvs Autocolante <[email-masked]>

Forwarding from Debian BTS to X2Go (upstream BTS)...

Mike

----- Weitergeleitete Nachricht von [email-masked] -----
      Datum: Tue, 9 Jul 2013 01:59:58 +0100
        Von: Kromitvs Autocolante <[email-masked]>
Antwort an: Kromitvs Autocolante <[email-masked]>,  
[email-masked]
    Betreff: [pkg-x2go-devel] Bug#715422: x2goclient: Strange  
characters on terminal emulators
         An: Debian Bug Tracking System <[email-masked]>

Package: x2goclient
Version: 4.0.1.0-0~x2go1+squeeze~main~380~build1
Severity: normal

Dear Maintainer,

When I use a terminal shell emulator (konsole, xfce-emulator, etc) on the
remote (server x2go), non-ascii characters (accented characters, for
instance) are not well printed.

The same thing happened when I ssh'ed to the same machine without "SendEnv
LANG LC_*" in /etc/ssh/ssh_config. Adding this again solved the question.

Executing locale on server terminal emulator results in all "POSIX", except
for LANG which is not set.

Best regards,

-- System Information:
Debian Release: 7.1
   APT prefers stable
   APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=pt_PT.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages x2goclient depends on:
ii  libc6           2.13-38
ii  libcups2        1.5.3-5
ii  libgcc1         1:4.7.2-5
ii  libldap-2.4-2   2.4.31-1+nmu2
ii  libqt4-network  4:4.8.2+dfsg-11
ii  libqt4-svg      4:4.8.2+dfsg-11
ii  libqtcore4      4:4.8.2+dfsg-11
ii  libqtgui4       4:4.8.2+dfsg-11
ii  libssh-4        0.5.4-1
ii  libstdc++6      4.7.2-5
ii  libx11-6        2:1.5.0-1+deb7u1
ii  libxpm4         1:3.5.10-1
ii  nxproxy         2:3.5.0.20-0+squeeze~main~405~build1
ii  openssh-client  1:6.0p1-4

Versions of packages x2goclient recommends:
ii  openssh-server  1:6.0p1-4
ii  rdesktop        1.7.1-1

Versions of packages x2goclient suggests:
pn  pinentry-x2go  <none>

-- no debconf information

----- Ende der weitergeleiteten Nachricht -----

-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Mihai Moldovan <[email-masked]>
Date: Sun, 23 Nov 2014 22:51:36 +0100

> for LANG which is not set.

This is strictly speaking NOT an x2go bug, but the way shells work.

We can workaround this using Mike's proposal and I'd second this.

Technical details: x2go connects via SSH and runs shell scripts. Those spawned
shells are non-interactive due to the fact that any of standard output or
standard error are not connected to a terminal.

(man bash: "An interactive shell is one started without non-option arguments and
without the -c option whose standard input and error are both connected to
terminals (as determined by isatty(3)), or one started with the -i option."
A non-interactive shell is therefore (-i option aside) a shell started with
non-option arguments or with the -c option or whose standard input or error are
not connected to terminals.)

POSIX definitions (
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html ) do not
require a shell to read any file at startup, but won't forbid it. This is simply
not mentioned at all.

bash enters POSIX conformity mode when started as "sh" and will *not* read any
files on startup. This is especially true for /etc/profile.

If it is spawned as "bash" in non-POSIX conformity mode, it will still *not*
read /etc/profile for non-interactive shells.

Mihai