Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure the "initial working directory" of the Terminal to be by default the same location as the current opened project?

Tags:

eclipse

When I open a Terminal in Eclipse, it's by default positioned at

$> /home/myUserName>$

I'm looking to configure it to be positioned at the same location as the current opened project.

Example

  • When I open the project "my-project-1" which is located at "/home/userName/path/to/my/personal/projects" then I open the Terminal, it'll be shown as this:

    $> /home/userName/home/userName/path/to/my/personal/projects/my-project-1>$

  • When I open the project "my-project-2" which is located at "/home/userName/path/to/my/personal/projects" then I open the Terminal, it'll be shown as this:

    $> /home/userName/home/userName/path/to/my/personal/projects/my-project-2>$

Note:

  • I'm using the Oxygen Release (4.7.0).
like image 774
Ala Eddine JEBALI Avatar asked Jul 12 '17 14:07

Ala Eddine JEBALI


People also ask

How do I change directory in Eclipse terminal?

Open the workspace and then the project folder. Then run the Terminal application, type “cd” into the terminal window. “cd” is the command to change directory (or folder).

What is meant by working directory?

In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just current directory.


3 Answers

From the Preferences -> Terminal -> "Local Terminal" configuration screen, you could chose ${project_loc} as initial working directory.

like image 117
Zack Avatar answered Oct 11 '22 02:10

Zack


You cannot do this for "the currently opened project", but you can get close enough by choosing a specific project.
Preferences -> Terminal -> Local Terminal. Select "Variables..."
You then choose ${project_loc}, then click on "Configure" in the Argument box, start typing your chosen project name, and select it

like image 32
PrOF Avatar answered Oct 11 '22 00:10

PrOF


It's September of 2021, running Eclipse 2021-06 and I still see "Variable references empty", and I get ../Eclipse.app/Contents/MacOS as my initial directory.

like image 1
John Windberg Avatar answered Oct 11 '22 02:10

John Windberg