Skip to content

Commit

Permalink
Use absolute folder path to open it as working dir in terminal (#11914)
Browse files Browse the repository at this point in the history
### What does this PR do?
This changes proposal modifies the behavior of _Open in Terminal_ action, so the current directory path pass to terminal options in absolute path form instead of relative as it was before.

Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>

### What issues does this PR fix or reference?
#10894 
<!-- #### Changelog -->
<!-- The changelog will be pulled from the PR's title. 
     Please provide a clear and meaningful title to the PR and don't include issue number -->


#### Release Notes
<!-- markdown to be included in marketing announcement - N/A for bugs -->
N/A

#### Docs PR
<!-- Please add a matching PR to [the docs repo](https://github.com/eclipse/che-docs) and link that PR to this issue.
Both will be merged at the same time. -->
N/A
  • Loading branch information
vzhukovs authored Nov 30, 2018
1 parent d8c1ad1 commit b3da3eb
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
@Singleton
public class OpenInTerminalAction extends AbstractPerspectiveAction {

private CoreLocalizationConstant locale;
private final ProcessesPanelPresenter processesPanelPresenter;

interface Command extends SafeHtmlTemplates {
Expand All @@ -59,8 +58,6 @@ public OpenInTerminalAction(
locale.openInTerminalAction(),
null,
machineResources.addTerminalIcon());
this.locale = locale;

this.processesPanelPresenter = processesPanelPresenter;
}

Expand All @@ -76,7 +73,7 @@ public void actionPerformed(ActionEvent event) {
final Container parent = resource.getParent();
resource = parent;
}
Path path = resource.getLocation().makeRelative();
Path path = appContext.get().getProjectsRoot().append(resource.getLocation());
Command cmdTmpl = GWT.create(Command.class);
String command = cmdTmpl.openInTerminalCommand(path.toString()).asString();
processesPanelPresenter.newTerminal(TerminalOptionsJso.create().withCommand(command), true);
Expand Down

0 comments on commit b3da3eb

Please sign in to comment.