Search code examples
macosstartupstartup-error

Mac OS X Lion: every time I shutdown or restart my lap…chrome and textmate open?


Every time I turn on or restart Mac OS X Lion...chrome and textmate open. Even if I uncheck "Reopen windows when logging back in" before shutdown or restart. Chrome and textmate do not appear on loggin items on Users & Groups from System Preferences so I can't uncheck them. Is very weird and I don't really know what to do. Some good ideas? Thanks!

I also delete textmate and chrome files from ~/Library/Saved Application State. But it didn't work. Thanks!


Solution

  • Run these two commands in a terminal:

    curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh
    chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh
    

    The contents of the downloaded script are as follows:

    #!/bin/bash
    echo "#!/bin/bash" > /tmp/loginfix.sh
    echo "rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*" >> /tmp/loginfix.sh
    mv /tmp/loginfix.sh /usr/bin/loginfix.sh
    chmod +x /usr/bin/loginfix.sh
    defaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh
    

    The state of the checkbox won't matter anymore, windows won't be getting restored

    Or you could just upgrade lion to 10.7.4, they fixed that bug