Set terminal directory to source file location

In "Session" one can set working directory to "source file location". I would enjoy if one could also set terminal directory to source file location - either at the same time or as a separate menu point.

There are two reasons: One is that I find it generally nice to have my shell "in the right directory". A more specific reason is that I often toggle back and forth between editing source files in Rstudio and in emacs (I find some editing facilities in emacs easier to use than those in Rstudio). And it is just easier to start emacs in the right directory if the terminal is set to the source file location.

Not sure if this will suit your workflow, but if you go to the Files tab, click More and then Open New Terminal Here, you'll get a terminal in the directory being shown by Files. The More menu also has an option to set the Files tab to the current working directory. Opening a new terminal does not close the original default terminal, but that's pretty harmless (and in any case you can switch back to the original terminal and close it by typing 'exit' on Linux or whatever the equivalent command is on your OS).

Thanks, that works for me :slight_smile: I also noticed that if I click the dropdown menu under a terminal, then there is a "go to current directory" option. Sorry, I should have looked more closely.