Terminal in PHPStorm won't remember last working directory?

PHPStorm won't remember my working directories after a restart of the app. 

I tried manually putting this in .idea/workspace.xml, without luck. PHPStorm just removes these entries if app quit. 

<component name="TerminalArrangementManager">
  <option name="myTabStates">
    <TerminalTabState tabName="ojs" currentWorkingDirectory="$PROJECT_DIR$" />
    <TerminalTabState tabName="pkp-lib" currentWorkingDirectory="$PROJECT_DIR$/lib/pkp" />
    <TerminalTabState tabName="ui-library" currentWorkingDirectory="$PROJECT_DIR$/lib/ui-library" />
    <TerminalTabState tabName="googleScholar" currentWorkingDirectory="$PROJECT_DIR$/plugins/generic/googleScholar" />
  </option>
</component>

I have already read the following: 
- https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010194720-Did-terminal-used-to-remember-the-last-directory
- https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010194720-Did-terminal-used-to-remember-the-last-directory
 

I have tried  with and without the new Terminal. 


Environment information:
- PHPStorm 2024.3 Build #PS-243.21565.202
- Ubuntu 22.04
- Installed .deb version from website

 

0

I have been playing around a bit more. 

The “TerminalArrangementManager” is not written in .idea/workspace.xml at all. If present, it's removed at app exit. 

If I open the terminals from mouse right click > Open In > Terminal, the state is remembered after a restart. But I can't find where this setting is saved. In all .idea directory, there is no entry. 

0

I managed to get it working in IntelliJ IDEA 2024.3 (Ultimate Edition), Build #IU-243.21565.193, built on November 13, 2024 with the help of your post and the screenshot in the thread you linked to.

Procedure:

  1. Open .idea/workspace.xml under your projects root directory
  2. Search for “ProjectId”, you should find an entry looking something like <component name="ProjectId" id="2o2HQyFrTvGWGkJFmI59uAzcRmR" />
  3. Open your IntelliJ settings directory (official guide)
  4. Open the workspace sub-directory in the settings directory above, path on Windows would be C:\Users\<Username>\AppData\Roaming\JetBrains\<IntelliJIdeaSomeVersion>\workspace
  5. Open the xml file with the same name as the ProjectId above, which is 2o2HQyFrTvGWGkJFmI59uAzcRmR.xml in my case.
  6. CLOSE INTELLIJ
  7. Look for the "TerminalArrangementManager" component in the xml file above, which should look something like <component name="TerminalArrangementManager">
  8. Add currentWorkingDirectory="$PROJECT_DIR$/your/desired/starting/directory" to each TerminalTabState entry, which should look something like <TerminalTabState tabName="Artifacts" userDefinedTabTitle="true" currentWorkingDirectory="$PROJECT_DIR$/build/artifacts">
  9. Save and close the file
  10. Start IntelliJ

IntelliJ will now start that terminal tab at the given location every time you start that project.

If you cd to some other location in that terminal, it will “snap back” to the configured location on next startup.

If you close the terminal, the entry will be removed from xml file and you will have to repeat this procedure again.

 

I hope this will be as helpful to you as it has been to me. Good Luck!

0
The issue was reported as https://youtrack.jetbrains.com/issue/IJPL-163552 to our bug tracker, reproduced, and will be investigated there.
You are welcome to follow the progress in the YouTrack ticket. 
See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135 if you are not familiar with our bug tracking system.
0

请先登录再写评论。