You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
2.0 KiB

10 years ago
---
layout: post
status: publish
published: true
title: Disable OSX Lion from re-opening saved app state
author:
display_name: sipp11
login: sipp11
email: sipp11@gmail.com
url: ''
author_login: sipp11
author_email: sipp11@gmail.com
wordpress_id: 872
wordpress_url: http://blog.10ninox.com/?p=872
date: '2012-02-28 05:50:44 +0700'
date_gmt: '2012-02-27 22:50:44 +0700'
categories:
- Uncategorized
tags: []
---
<p>If you are like me, hate to see all closed files or tabs coming back after re-opening applications in Lion, you won’t be pissed any more.</p>
<p>Basically, Lion saves every single thing you do in every single applications in<code>~/Library/Saved Application State</code>. This is where the problem rises. Every applications will look at this saved state while opening up and will try to restore back to the same right before you closed, which I find this behavior annoying.</p>
<p>To fix it: You have 2 choices,<br />
1. disable write-access to this directory, by using <code>chmod</code> command. This will disable in every apps or by each app depending on which directory you are changing.<br />
2. disable savedState per application by using command</p>
<p><code>defaults write [application_name] NSQuitAlwaysKeepsWindows -bool false</code></p>
<p>where application_name will look like following:-<br />
&gt;&gt; <code>com.microsoft.Word</code> for Microsoft Word<br />
&gt;&gt; <code>com.apple.Safari</code> for Safari<br />
&gt;&gt; <code>com.google.Chrome</code> for Chrome</p>
<p>Example, to disable saved state for Microsoft Word, do as following:-<br />
<code>defaults write com.microsoft.Word NSQuitAlwaysKeepsWindows -bool false</code></p>
<p>You can find by open <code>~/Library/Saved Application State</code> and look at the name. Unfortunately, Lion also keeps <code>~/Library</code> hidden too. You can fire up terminal and type<code>open Library</code> to open <code>~/Library</code> in Finder and go through quickly.</p>
<p><em>To revert action</em>: just use the same command with <code>-bool true</code></p>