Skip to content

Commit 89877dd

Browse files
committed
Clean up terminal LANG variable
1 parent 82f1170 commit 89877dd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ export class TerminalInstance implements ITerminalInstance {
616616
private static _getLangEnvVariable(locale?: string) {
617617
const parts = locale ? locale.split('-') : [];
618618
const n = parts.length;
619-
const language = parts[0];
620619
if (n === 0) {
621-
return 'en_US.UTF-8'; // Avoid encoding problem with special chars. Issue #14586
620+
// Fallback to en_US to prevent possible encoding issues.
621+
return 'en_US.UTF-8';
622622
}
623623
if (n === 1) {
624624
// app.getLocale can return just a language without a variant, fill in the variant for
@@ -634,8 +634,8 @@ export class TerminalInstance implements ITerminalInstance {
634634
ru: 'RU',
635635
zh: 'CN'
636636
};
637-
if (language in languageVariants) {
638-
parts.push(languageVariants[language]);
637+
if (parts[0] in languageVariants) {
638+
parts.push(languageVariants[parts[0]]);
639639
}
640640
} else {
641641
// Ensure the variant is uppercase

0 commit comments

Comments
 (0)