"Restored" in Terminal

Discussion in 'OS X Mavericks (10.9)' started by Mac Pro 2009, Nov 25, 2014.

  1. Mac Pro 2009, Nov 25, 2014
    Last edited: Nov 25, 2014

    Mac Pro 2009 macrumors member

    Joined:
    Jan 3, 2014
    #1
    Hey everyone!
    Noticed some strange behaviour in terminal recently, after a clean install of Mavericks, terminal suddenly remembers everything I ever typed in... How do I make this stop? Should I be worried by this? Never had this happen before...
    Thanks!
     
  2. Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #2
    That's the intended behaviour so if it wasn't working before there was something wrong (probably ownership of the .bash_history file)
     
  3. Mac Pro 2009 thread starter macrumors member

    Joined:
    Jan 3, 2014
    #3
    It is? Well is there a way to stop terminal from showing the [Restored] stuff?
     
  4. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #4
    Are you talking about the history of previous commands that is shown when you up arrow? You can delete that be entering "history -c" (without the quotes).
     
  5. Mac Pro 2009 thread starter macrumors member

    Joined:
    Jan 3, 2014
    #5
    What I mean is that whenever I open terminal it lists all my previous commands (like from two days ago) above "[Restored]". I find this to be an annoyance...
     
  6. Phil A., Nov 25, 2014
    Last edited: Nov 25, 2014

    Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #6
    Sorry, I misunderstood what you meant before.

    To stop this you have to do the following (which will affect all applications):

    In system preferences, general, set the check box next to "Close windows when quitting an app"

    You can also do it with the following command which then applies to Terminal only

    Code:
    defaults write com.apple.Terminal NSQuitAlwaysKeepsWindows -bool false
    

    To return to the default behaviour of following the settings in system prefs use this command

    Code:
    defaults delete com.apple.Terminal NSQuitAlwaysKeepsWindows
    


    Close and re-open Terminal for it to take effect


    The third option is simply to make sure you close all terminal windows before quitting :)
     
  7. Mac Pro 2009 thread starter macrumors member

    Joined:
    Jan 3, 2014
    #7
    That worked, you are a genius! Thanks man!
     
  8. Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #8
    no worries - glad to be able to help :)
     
  9. sharon22 macrumors regular

    Joined:
    Oct 19, 2014
    #9
    Hello OP, you got some good answers. But before you go and "turn off" the "remember history" setting, I want to submit that my FAVORITE feature of Terminal (or any Command-Line application) is having it remember history! OMG I cannot COUNT how many times I am thankful that it remembers history.

    Obviously, it may be of a privacy concern if you are on a shared computer... but if you are NOT on a shared computer, please consider leaving the History "on" for a few months. If it turns out you *never* use this default feature, then turn it off.

    Case in point: On occasion, I do that "sudo remove force Trash **" thingy, to "force empty trash." Well, see, Terminal only keeps the past 500 commands, and my Force Empty trash was lost, so I figured I had used it enough that I should have it memorized. Well, I had an extra space in the command, and ended up DELETING NEARLY ALL of my entire home directory! Permanently! Now, if the "sudo force delete trash" command was in my Terminal, I could have just hit the "up arrow" 'till I found it, then it would have worked properly instead of deleting my whole computer.

    Just a thought.

    Do as thout wishest :D
     

Share This Page