From b3da3eb3d9d9f573e61d1628dc41b0096908dc28 Mon Sep 17 00:00:00 2001 From: Vladyslav Zhukovskyi Date: Fri, 30 Nov 2018 15:07:06 +0200 Subject: [PATCH] Use absolute folder path to open it as working dir in terminal (#11914) ### 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 ### What issues does this PR fix or reference? #10894 #### Release Notes N/A #### Docs PR N/A --- .../org/eclipse/che/ide/processes/OpenInTerminalAction.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/OpenInTerminalAction.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/OpenInTerminalAction.java index 25b4c93ccea..a8dda1f4ec1 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/OpenInTerminalAction.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/OpenInTerminalAction.java @@ -40,7 +40,6 @@ @Singleton public class OpenInTerminalAction extends AbstractPerspectiveAction { - private CoreLocalizationConstant locale; private final ProcessesPanelPresenter processesPanelPresenter; interface Command extends SafeHtmlTemplates { @@ -59,8 +58,6 @@ public OpenInTerminalAction( locale.openInTerminalAction(), null, machineResources.addTerminalIcon()); - this.locale = locale; - this.processesPanelPresenter = processesPanelPresenter; } @@ -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);