File tree Expand file tree Collapse file tree
src/vs/workbench/parts/terminal/electron-browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -562,16 +562,11 @@ export class TerminalInstance implements ITerminalInstance {
562562 } ) ;
563563 }
564564 env [ 'PTYCWD' ] = cwd ;
565- if ( locale ) {
566- env [ 'LANG' ] = TerminalInstance . _getLangEnvVariable ( locale ) ;
567- }
565+ env [ 'LANG' ] = TerminalInstance . _getLangEnvVariable ( locale ) ;
568566 if ( cols && rows ) {
569567 env [ 'PTYCOLS' ] = cols . toString ( ) ;
570568 env [ 'PTYROWS' ] = rows . toString ( ) ;
571569 }
572- if ( ! env [ 'LANG' ] ) {
573- env [ 'LANG' ] = 'en_US.UTF-8' ; // Avoid encoding problem with special chars. Issue #14586
574- }
575570 return env ;
576571 }
577572
@@ -618,12 +613,12 @@ export class TerminalInstance implements ITerminalInstance {
618613 return newEnv ;
619614 }
620615
621- private static _getLangEnvVariable ( locale : string ) {
622- const parts = locale . split ( '-' ) ;
616+ private static _getLangEnvVariable ( locale ? : string ) {
617+ const parts = locale ? locale . split ( '-' ) : [ ] ;
623618 const n = parts . length ;
624619 const language = parts [ 0 ] ;
625620 if ( n === 0 ) {
626- return '' ;
621+ return 'en_US.UTF-8' ; // Avoid encoding problem with special chars. Issue #14586
627622 }
628623 if ( n === 1 ) {
629624 // app.getLocale can return just a language without a variant, fill in the variant for
You can’t perform that action at this time.
0 commit comments