Mac OS X / Open terminal with specified windows

前端 未结 9 1066
逝去的感伤
逝去的感伤 2020-12-13 09:57

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.tx         


        
相关标签:
9条回答
  • 2020-12-13 10:35

    I suspect you can control commands to be executed too. One of the programs I use creates a single-tab terminal window and arranges to execute a profile-setting script before continuing to the command prompt - the same should be feasible for a multi-tab terminal. The file is a MacOS X properties XML file.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>CommandString</key>
        <string>. /Applications/IBM/informix/demo/server/profile_settings</string>
        <key>FontAntialias</key>
        <false/>
        <key>RunCommandAsShell</key>
        <false/>
        <key>ShowShellCommandInTitle</key>
        <true/>
        <key>TerminalType</key>
        <string>xterm</string>
        <key>WindowTitle</key>
        <string>IDS Command Window</string>
        <key>name</key>
        <string>IDS Command Window</string>
        <key>type</key>
        <string>Window Settings</string>
    </dict>
    </plist>
    

    You can click on it and the terminal window is launched, the profile settings are set, and then you have a command prompt to type at. Presumably, changing the 'dot' command into the 'tail' command of the question would work; it might be that the 'RunCommandAsShell' key set to '<true\>' would replace the normal shell with the command - which is perhaps more appropriate for the question.

    0 讨论(0)
  • 2020-12-13 10:35

    Another way of doing this is by using the Elscripto ruby gem: https://github.com/Achillefs/elscripto. It allows yuo to easily specify terminal tabs using a YAML file

    0 讨论(0)
  • 2020-12-13 10:36

    Open the tabs you want and set each one up as you wish, i.e. in tab 1, cd /etc, tab 2 cd /bin and so on. Now go to Window > Save Windows as Group. Click the checkbox 'Use window group when Terminal starts' and hey presto!

    0 讨论(0)
提交回复
热议问题