I want to open a terminal and automatically open a folder and run a command within it
For this, I have the following:
:~$ gnome-terminal --working-directory=/home/project -- code .
This runs code . (opens VSCode in the current folder) after it opens the terminal in /home/project.
Is this behaviour guaranteed that it will navigate to the working directory and then run
code .I ask because I do not want
code .to run in the current directory from where the command is issued and then the terminal opens in the working directory.This seems to work fine if the working directory exists. But if
/home/projectdoes not exist, I want the entirety of the above command to fail. At present, it still runscode .if the working directory does not exist in the current folder from the above command is issued.