Where are OS X Terminal Window Groups saved - macos

I know you can save Window Groups in Terminal using Windows > Save Windows as Group…, as explained in Mac OS X / Open terminal with specified windows.
However, where does Terminal save these states? I switch between an iMac and MacBook and want to sync these settings somehow. I'm thinking I could use a reverse symlink between the settings and Dropbox, but I need to know where they are first.

Window groups are saved in a plist file at ~/Library/Preferences/com.apple.Terminal.plist. You an edit these using the plist file editor that comes with XCode ('open .apple.Terminal.plist' from a shell is sufficient if you've got XCode installed).
Fortunately you don't have a catch-22 when editing this file from a Terminal window. Terminal doesn't automatically checkpoint the file on exit, so you can edit the file, exit Terminal, then restart your Mac in order to refresh the data from the file.

Related

MacOS screencapture only taking images of Desktop

I created an applescript shortcut to take screenshot (larger usecase). But the resulting saved screenshot is only of the Desktop, even if other applications are in focus. Here is my applescript snippet
do shell script "screencapture -dxi /private/tmp/test.png"
I am also compiling with osacompile and launching the app through the Finder. I've also checked file directory and permissions (+ System Preferences) while everything checks out.
If I was to execute this command from the terminal then it would run as expected. My guess is that by running the app by double-clicking int the finder then a different user is used and results in inadequate permissions.

What is the terminal command line in OSX Mojave to find the folder where screenshots are saved?

What Terminal command in OSX will show the path where screenshots are set to save? I am trying to find a screenshot I took last week on my Macbook Pro running OSX Mojave. There are no screenshots saved on my desktop which I understand to be the default save location. Therefore I am thinking I changed the save location but don't remember where.
I already tried searching for 'Screenshots' in Finder but this only shows screenshots taken before Oct 2018 even though I have taken many since then, including in the last hour. Same for the 'Screenshots' folder in my Dropbox.
I also verified that the screenshot shortcut I used Command+Shift+4 is correctly set to 'Save picture of selected area a file' and 'Copy picture of selected area to the clipboard'. I verified this in System Preferences > Keyboard > Shortcuts > ScreenShot. And successfully took a screenshot with this shortcut just now.
This works for me on macOS Mojave 10.14.3:
defaults read com.apple.screencapture location
Sample Output
~/Desktop

How to change the icon of Terminal default on Mac OS

How can I change the icon on the Terminal app on Mac OS?
I can change the icon on other apps but I can't change it for the Terminal.
I tried to change the icon for the Terminal app without success.
It requires admin authentication, but I'm using an admin account, can I change it?
You can make a copy of the Terminal app, place that copy inside /Applications. Perform the icon change on that copy and rename the copy to something like "MyTerminal" so that you can tell the difference in Spotlight.

Sandbox is not allowed to open documents in Terminal

Recently I developed an application in Xcode using Swift that starts up the Terminal like this and:
open -a /Application/Utilities/Terminal.app /project/run_stack.sh
After exporting the Application and trying to run it I get this message if my Terminal is running already or I have previously started the same command from the same app (the command is executed through a menu item).
ru_stack.sh can’t be opened because Sandbox is not allowed to open documents in Terminal.
Anyone know why this happens ? If I run it on my Mac it works fine and each time a new terminal starts on the call but when I tried the application on my friend's Mac we get that error in the described cases.
I was having the same problem. I ended up setting iTerm2 as the "Open With" application for .sh files and that fixed my issue. https://iterm2.com/

Setting the default directory where screenshots are saved

I am writing a utility that changes the directory where the Mac OS X saves the screenshots taken when pressing the shortcuts listen in the Keyboard preference panel. Where should that value be saved, to be used from the Mac?
In ~/Library/Preferences/com.apple.screencapture.plist under the key location. Source: http://hints.macworld.com/article.php?story=20050824073301844

Resources