dot/profile: Bodge to preserve `LANG' across SSH.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 30 Apr 2018 16:51:57 +0000 (17:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 30 Apr 2018 16:51:57 +0000 (17:51 +0100)
This is Debian #392856, OpenSSH upstream #1346.  Retain our chosen
`LANG' in another variable `LC_MDWSSHLANG', and reset the former from
the latter if it exists.  The bizarre name helps with transmitting our
new variable through SSH connections and suchlike which might have
random limitations on environment variables.

dot/profile

index 925127d..db91c92 100644 (file)
@@ -133,8 +133,11 @@ unset ed emacs_startup_args
 ###--------------------------------------------------------------------------
 ### Locale configuration.
 
-case ${DISPLAY+t} in
-  t)
+case ${LC_MDWSSHLANG+t},${DISPLAY+t} in
+  t,*)
+    LANG=$LC_MDWSSHLANG
+    ;;
+  ,t)
     __mdw_setconf LANG x-ctype POSIX
     ;;
   *)
@@ -156,6 +159,10 @@ export LANG
 
 LC_COLLATE=POSIX; export LC_COLLATE
 
+case ${LANG+t} in
+  t) LC_MDWSSHLANG=$LANG; export LC_MDWSSHLANG ;;
+esac
+
 ###--------------------------------------------------------------------------
 ### Pagers.