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 eclipse-theia#7597
  • Loading branch information
corneliusludmann committed Apr 17, 2020
1 parent ebf7b78 commit 1c9143b
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 1c9143b

Please sign in to comment.