Skip to content

Commit

Permalink
Fix lower case drive letter in intergrated terminal on Windows
Browse files Browse the repository at this point in the history
Fixes #9448
  • Loading branch information
Tyriar committed Sep 9, 2016
1 parent a6c845b commit a2ebd67
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,21 @@ export class TerminalService implements ITerminalService {
shell.args.forEach((arg, i) => {
env[`PTYSHELLARG${i}`] = arg;
});
env['PTYCWD'] = workspace ? workspace.resource.fsPath : os.homedir();
env['PTYCWD'] = this.sanitizeCwd(workspace ? workspace.resource.fsPath : os.homedir());
if (locale) {
env['LANG'] = this.getLangEnvVariable(locale);
}
return env;
}

private static sanitizeCwd(cwd: string) {
// Make the drive letter uppercase on Windows (see #9448)
if (platform.platform === platform.Platform.Windows && cwd && cwd[1] === ':') {
return cwd[0].toUpperCase() + cwd.substr(1);
}
return cwd;
}

private static cloneEnv(env: IStringDictionary<string>): IStringDictionary<string> {
let newEnv: IStringDictionary<string> = Object.create(null);
Object.keys(env).forEach((key) => {
Expand Down

0 comments on commit a2ebd67

Please sign in to comment.