使用当前工作目录在OSX上打开多个新的终端选项卡

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用当前工作目录在OSX上打开多个新的终端选项卡相关的知识,希望对你有一定的参考价值。

  1. # Open a new tab on OSX Terminal with the current working dir.
  2. # Optionally, pass the number of tabs as parameter.
  3. #
  4. # Example:
  5. #
  6. # cd /my/very/long/path/and/i/dont/want/to/repeat/myself
  7. # nt 10
  8. #
  9. # You should add this to your ~/.profile
  10. #
  11. function nt {
  12. if [ $# -ne 1 ]; then
  13. TIMES=1
  14. else
  15. TIMES=$1
  16. fi
  17.  
  18. osascript -e "
  19. repeat $TIMES times
  20. tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down
  21. tell application \"Terminal\" to do script \"cd $PWD; clear;\" in selected tab of the front window
  22. end repeat
  23. " > /dev/null 2>&1
  24. }

以上是关于使用当前工作目录在OSX上打开多个新的终端选项卡的主要内容,如果未能解决你的问题,请参考以下文章

如何在同一目录的 Windows 终端中打开一个新的 git-bash 选项卡?

osx上的终端和工作台中的mysql数据库不同

iTerm2和tmux:在当前选项卡的工作目录中打开新选项卡

如何在终端中打开应用程序并传递当前工作目录?

python tab 补全 Mac OSX 10.7 (Lion)

每次创建新的服务器实例时生成一个随机端口号