Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
746 views
in Technique[技术] by (71.8m points)

macos - Mac OS X / Open terminal with specified windows

Is it possible to open a terminal window with 3 tabs. Each tab should have different path.

Example:

Tab1: /etc
Tab2: /bin
Tab3: /www/ tail -f file.txt
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is absolutely possible, but it will take some work on your part. The first thing you need is to set up each window/tab you want in your Settings:

Settings

I have 4 tabs that I open automagically every time I open Terminal. DB Shell, Editor, Server, and Shell. These are all within the Sasquatch (don't ask) project, thus the naming. Each of these should then have a unique command associated with them:

startup cmd

In this case, I'm executing vim. If you happen to have a specific directory you'd like to start off in, you can use something like vim ~/projects/main/. Really whatever you want to go in there is the command the shell will execute when it opens. Now you need to open all your windows/tabs:

  1. Close everything.
  2. Open a new window for each of your profiles.
    • Go to the Shell menu => New Tab/New Window => Select the profile you created above.
    • Repeat for each window or tab you want.
  3. Once you have all of your windows and/or tabs open, save them as a Window Group.
    • Go to the Window menu => Save Window As Group....
    • Give your Window Group a name (this is helpful later).
    • If you want this group to open every time you open Terminal, check the box at the bottom of this screen, and then hit save.
  4. Close out of all of your Windows/Tabs (time to test it!).
  5. Open your new Window Group.
    • Go to the Window menu => Open Window Group => Select the group you just made.

This should pop up all the windows you just had, in the same position. Each of the commands you set up in Settings should be launched in their respective tabs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...