Skip to content

Commit

Permalink
Use normalized URI in Terminal CWD selector
Browse files Browse the repository at this point in the history
If you have configured a workspace folder like
```
"path": "../../workspace"
```
you get a Terminal for URI `/workspace/theia/../../workspace` instead of `/workspace`. This commit fixes this by using a normalized path in the terminal cwd selector.

Fixes #7597

Signed-off-by: Cornelius A. Ludmann <cornelius.ludmann@typefox.io>
  • Loading branch information
corneliusludmann committed Apr 17, 2020
1 parent ebf7b78 commit 375a0b7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,14 @@ export class TerminalFrontendContribution implements TerminalService, CommandCon
protected async selectTerminalCwd(): Promise<string | undefined> {
const roots = this.workspaceService.tryGetRoots();
return this.quickPick.show(roots.map(
({ uri }) => ({ label: this.labelProvider.getName(new URI(uri)), description: this.labelProvider.getLongName(new URI(uri)), value: uri })
({ uri }) => {
const normalizedUri = new URI(uri).normalizePath();
return {
label: this.labelProvider.getName(normalizedUri),
description: this.labelProvider.getLongName(normalizedUri),
value: normalizedUri.toString()
};
}
), { placeholder: 'Select current working directory for new terminal' });
}

Expand Down

0 comments on commit 375a0b7

Please sign in to comment.