I want to use a script to change my terminal settings for my Mac, so it can close the window when exiting the terminal. I use this command in a script:
/usr/libexec/PlistBuddy -c "Set \"Window Settings\":Basic:shellExitAction 0" ~/Library/Preferences/com.apple.Terminal.plist
Now the problem is that after the script is executed, the .plist file will be changed, I will check it for
defaults read com.apple.Terminal "Window Settings"
Now the value is 0.
But the problem is that the terminal does not reload the .plist file, and when I exit the terminal, it again overwrites the .plist file as "2". So my question is how to let the terminal reload the .plist file at startup or stop it from rewriting the file when it exits.
source share