title: Change directory of current terminal with python cli tool
body: <p>I am working on a simple cli tool for changing project directories of the current terminal window. The cli tool is writen in python using the click package. From what I have seen I don't think it is possible to change the directory but maybe someone has so insight that would help.</p>
  
  <p>For the example workflow</p>
  
  <pre><code>$ pwd
  /home/username
  $ grab open projectA
  $ pwd
  /home/username/projects/projectA
  $ grab open projectB
  $ pwd
  /home/username/projects/different/location/projectB
  </code></pre>
  
  <p>The things that I do know.</p>
  
  <ul>
  <li>Using python <code>os.chdir(path)</code> only works in side the current script and has no affect on the terminal once executed.</li>
  <li>Trying python <code>subprocess.run(['cd', 'path'])</code> will throw a <code>FileNotFoundError: [Errno 2] No such file or directory: 'cd'</code> </li>
  <li>Running <code>$ source change_dir.sh</code> will work on the command line but try in a <code>subprocess</code> the same <code>FileNotFoundError</code> will be raised. Note, change_dir.sh is a simple script that that uses cd to change path.</li>
  </ul>
  
  <p>I am really looking for a way around this issue or to be told this is not possible to do.
  The next thing I might try is lunching a bash shell in the terminal similar to what happens when launching a virtual environment with python. 
  Off the bat this feel like the wrong way to me.  </p>
  
  <p>Any advice is will be helpfully. </p>