A number of Mac admins have their Terminal appearance settings configured just the way they like them, but it can be a bit of manual work to export and import them. After having to manually configure and export these settings more than a few times, I wanted to see if it was possible to export these settings in a way to make it easy to convert into a configuration profile.
With a little work and research, I was able to write a script which handled exporting the Terminal profile I wanted into a properly formatted plist file. For more details, please see below the jump.
The script I wrote is named Export_Mac_Terminal_Profiles and it is a .command file, which means it can be run by double-clicking on it. To use it, please use the following procedure:
- Identify the name of the Terminal profile you want to export.
- Double-click on the Export_Mac_Terminal_Profiles.command script.
- Enter the name of the Terminal profile you want to export.
- Decide if you want the exported Terminal profile to be set up as a default profile. By specifying it as a default profile, the exported Terminal profile will be configured as both a startup profile and as a default profile.
In this example, I’ve configured a custom Terminal profile named Documentation in my account’s Terminal settings and want to export it for use with a configuration profile.
To export it, I followed the procedure described above and entered the following when prompted:
Name: Documentation
Default profile: 1 (which configures the exported profile to be set as both a startup profile and as a default profile.)
When the script finished running, it opened a Finder window showing me a com.apple.Terminal.plist file.
This plist file contained all of the settings needed to create a configuration profile which did the following:
- Install the Documentation Terminal profile
- Configure the Documentation Terminal profile as both a startup profile and as a default profile.
From there, I used Tim Sutton‘s mcxToProfile tool to create a configuration profile from the exported com.apple.Terminal.plist file.
Once I had the configuration profile, I verified that I was able to install it and that the Documentation Terminal profile was now installed and set as the default profile.
However, one side effect I noticed was that installing a Terminal profile using a configuration profile resulted in all other Terminal profiles vanishing from the Terminal preferences.
To restore copies of the OS-provided Terminal profiles, click on the Profiles window’s cog wheel and select Restore Default Profiles.
This will restore the OS-installed Terminal profiles in their default configuration. This restore process will not affect the Terminal profile installed by the configuration profile.
The Export_Mac_Terminal_Profiles script is available below and also on GitHub at the following address:
The example configuration profile for the Documentation Terminal profile is also available below.