Opening a new terminal tab in OSX(Snow Leopard) with the opening terminal windows directory path

前端 未结 5 815
难免孤独
难免孤独 2021-02-01 20:37

I\'ve been Googling for a while looking for a simple way to do this, and I can\'t find one.

I have a custom terminal environment set up (zsh) with various aliases and fu

5条回答
  •  余生分开走
    2021-02-01 21:05

    In my answer here, I provided a function and an alias:

    function cd () { command cd "$@"; echo "$PWD" > /tmp/CWD; }
    export cd
    
    alias cdp='cd $(cat /tmp/CWD)'
    

    You should be able to put a (possibly conditional) statement at the end of your ~/.bashrc or ~/.zshrc to execute that alias.

提交回复
热议问题