setting the terminal default path to the current project path


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

Any ideas?


Thanks in advance


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


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


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


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.


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



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?



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 }`


in my .bashrc I have a cd for when I run bash outside Intellij. This overrides the Start directory default in IntelliJ. Is there a way around that?


No, as the terminal sources .bashrc


Please sign in to leave a comment.