title: Reload com.apple.Terminal.plist
body: <p>I want use a script to modify the preferences of my terminal for my Mac, so it can close the window when exit the terminal. I use this command  in the script:</p>
  
  <p><code>/usr/libexec/PlistBuddy -c "Set \"Window Settings\":Basic:shellExitAction 0" ~/Library/Preferences/com.apple.Terminal.plist</code></p>
  
  <p>Now the problem is after execute the script, the .plist file is do changed, I check it by</p>
  
  <p><code>defaults read com.apple.Terminal "Window Settings"</code></p>
  
  <p>The value is 0 now.</p>
  
  <p>But the problem is the terminal not reload the .plist file, and when I exit the terminal, it rewrite the .plist file as '2' again. So my question is how to let terminal reload the .plist file when it's running or stop it rewrite the file when it exit.</p>