setting the terminal default path to the current project path

Hi,

I would like to launch the terminal plugin from the current project path I am working on.

Any ideas?

 

Thanks in advance

7 comments
Comment actions Permalink

Not sure I follow you... the built-in terminal opens in a project root directory by default. You can alter this behavior by specifying a directory to start in in Settings | Tools | Terminal, Start directory

1
Comment actions Permalink

thanks, but there is still a problem.

I noticed that it states the right path under 'Start directory', but when I launch the terminal plugin when im already in my current project, it still starts from the default terminal path and not from the current project path

1
Comment actions Permalink

Do you have `cd` commands defined in your .bashrc, etc? what OS are you on, what do your terminal preferences look like?

1
Comment actions Permalink

Well... You can configure the directory to start in - it's Preferences | Tools | Terminal, Start directory. But it looks as if you have a cd command or some scripts in your shell configuration file that cause the shell to сhange directory to your home dir on opening. Please check your .bashrc,.bash_profile, etc.

1
Comment actions Permalink

On Windows be sure that you have not overridden the

Set-Location powershell cmd in your $PROFILE (powershell profile).
 
how check:
 
open powershell
 
issue command : code $PROFILE  (requires vscode installed) or notepad $PROFILE

 

1
Comment actions Permalink

Im using macOS.

I`ll try to explain myself better using an example. Lets say my default working directory in bash is /Users/Jeho and my project is located in /Users/Jeho/project. After opening my project on WebStorm, I would like the built-in terminal to open directly on /Users/Jeho/project and not /Users/Jeho (and then navigate to /Users/Jeho/project). Anyway to configure it in WebStorm?

thanks

0
Comment actions Permalink

I had a default path defined in my profile. What helped to have the correct folder in Pycharm without changing the path elsewhere was to set an environment variable `PYCHARM=1` in Settings | Tools | Terminal, Environment variables

and using a condition in my powershell profile:

`if ($null -eq $env:PYCHARM) { Set-Location ~\another_folder }`

0

Please sign in to leave a comment.