Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

marsbar

macrumors newbie
Original poster
Aug 20, 2008
7
0
Each time i restart my terminal I lose the previous command history. This is quite annoying.

Anyone know the solution to this problem?

:confused:
 
If closed the terminal session, I don't expect it to retain the history. Is the window closed but the program still running or do you exit completely out of the terminal?
 
Normally the terminal history will be available even when you've quit and re-opened it. I've tried this before, it worked great (and used it alot) in Leopard, and friends at my university have it working like that in Snow Leopard as well. I thought it was default, and I have looked at the Terminal prefs a thousand times, but I just can't figure it out:confused:
 
This is not a function of the terminal app. It is a function of your shell. If, for instance, you are using bash (the default) then your command history is stored in your home directory in a file called .bash_history

I would start by checking that that file exists and has read and write permissions for your user.
 
You're correct, it should retain your command history. They're stored in your home folder in a file called .bash_history

Maybe the permissions for this file are messed up? Have you tried repairing permissions?

Just throwing out some ideas.
 
You might need to hit Ctrl-D (or type logout) to close bash and write the history file. I thought it wrote the history as you typed the commands though.
 
On OS X, bash defaults to automatically save 500 lines of history, so I suspect you're using a different shell. The default settings for tcsh, for example, don't save any command history. If this is your shell, you would add something like this to your .tcshrc file (or .cshrc if .cshrc already exists):

Code:
set history=500
set savehist=500
 
I am using bash...

However, I've been setting up SVN and have been creating and editing a file (.bash_profile). In the file I only inserted this line:

export PATH=/opt/subversion/bin/:$PATH

I was following the tutorial at THIS website.

I checked to see if there was a .bash_history file, and there was. It holds nothing, however.

I am really puzzled, and tempted to format and reinstall Snow Leopard:(
 
I tried that and it worked!!! Thanks a lot :)

Don't know what happened.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.