I use the bash terminal on Ubuntu Ubuntu 20.04.5 LTS, with the GNOME terminal emulator. When using the terminal, this is the current (default) behavior:
- When I open a new terminal session, it starts in
~
. - When I open a new terminal tab from a directory, say
path/to/dir
, the new tab starts in this directorypath/to/dir
.
I would like to change 1) without changing 2). I want to start a new terminal session from ~/start
, but new tabs should still open in the current directory. How can I achieve this?
The otherwise perfect answer from this question (adding cd /start
to .bashrc
) does change 2) - with this, new tabs start in /start
regardless of the current directory.
From comments at the same answer, I figure that the behavior "open a new tab" is not a bash function, but there must be some additional logic which makes "open a new tab" more than "open a new terminal". I assume that there is something going on in the terminal emulator which ensures the behavior specified at 2). But I am not even sure about that, and I would not know how to change it.
gnome-terminal --working-directory=...
cmdline option, e.g. at https://askubuntu.com/q/1435378/398785. – egmont Feb 26 '23 at 16:42