Skip to content

Commit

Permalink
propagate locale settings with option --WSL (mintty/wsltty#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Oct 5, 2020
1 parent c1af63f commit 403e8bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/mintty.1
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ otherwise, it refers to the installed WSL packages as listed by the
Windows tool \fBwslconfig /l\fP or \fBwsl -l\fP.
Implies \fB--wsl -o Locale=C -o Charset=UTF-8\fP, \fB--rootfs=\fP...,
and \fB--icon=\fP... if a respective icon file exists for the distribution.
Also sets up the gateway to propagate locale settings LANG, LC_CTYPE, LC_ALL
and environment variable APPDATA to the WSL session.

.TP
\fB--WSLmode\fP \fIWSL DISTRIBUTION NAME\fP
Expand Down
7 changes: 7 additions & 0 deletions src/winmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -4992,6 +4992,7 @@ main(int argc, char *argv[])
#ifdef wslbridge2
argc += start_home;
#endif
argc += 6; // LANG, LC_CTYPE, LC_ALL

char ** new_argv = newn(char *, argc + 8 + start_home + (wsltty_appx ? 2 : 0));
char ** pargv = new_argv;
Expand Down Expand Up @@ -5029,6 +5030,12 @@ main(int argc, char *argv[])
#endif
*pargv++ = "-e";
*pargv++ = "APPDATA";
*pargv++ = "-e";
*pargv++ = "LANG";
*pargv++ = "-e";
*pargv++ = "LC_CTYPE";
*pargv++ = "-e";
*pargv++ = "LC_ALL";
if (start_home) {
#ifdef wslbridge2
*pargv++ = "--wsldir";
Expand Down
3 changes: 3 additions & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Window handling
* Keep hotkey-started window in taskbar (#1035).
* Override font zooming also with Ctrl, to support FancyZones (#487).

Character encoding
* Propagate locale settings with option --WSL (mintty/wsltty#259).

### 3.4.0 (19 September 2020) ###

Window handling / Tabs
Expand Down

0 comments on commit 403e8bc

Please sign in to comment.