Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal.app

(Hello, it looks like the UNIX forum has been eliminated from the Apple forums group. Sorry to see it go.)


When I launch Terminal.app and a shell appears, it writes some of my command history directly above the command prompt. I would rather have Terminal start new shells without history. I checked my bash profiles and could find nothing that would cause history to occur in a new shell, nor could I find anything in the Terminal.app preferences that would cause that to happen.


I added the clear command to my .bashrc profile and that indeed gets rid of the history information, but I would prefer to disable it from where that command is originating from. I implemented the bash security patch a long time ago, perhaps that was the cause? Or perhaps that is just default bash behavior and I have grown used to it.


Thanks to anyone who can enlighten me as to why that is occurring.


Tim

Mac Pro, Mac OS X (10.7), Switched 100 Ethernet

Posted on Jul 31, 2015 3:41 PM

Reply
Question marked as Best reply

Posted on Jul 31, 2015 4:07 PM

Enable Terminal -> Preferences -> Settings -> Window -> Limit number of rows to: nnnnn


This should change the behavior you are seeing.


Your scroll back history will restart on each Terminal session.


Choose how large a scroll back you want. The more you specify the more memory Terminal can chew up if you spend a lot of time in the Terminal. NOTE: I live in terminal sessions at work, so I have 10,000, but that is over kill, and I have lots of RAM on my work iMac.

3 replies
Question marked as Best reply

Jul 31, 2015 4:07 PM in response to Tim Semic

Enable Terminal -> Preferences -> Settings -> Window -> Limit number of rows to: nnnnn


This should change the behavior you are seeing.


Your scroll back history will restart on each Terminal session.


Choose how large a scroll back you want. The more you specify the more memory Terminal can chew up if you spend a lot of time in the Terminal. NOTE: I live in terminal sessions at work, so I have 10,000, but that is over kill, and I have lots of RAM on my work iMac.

Aug 1, 2015 12:06 AM in response to BobHarris

Hello Bob,

I edited the preference you suggested. I used 0, and then I tried entering 1, relaunching Terminal after each edit to test, but that didn't seem to have any effect. It has been a while since I have used terminal app but I now remember that I always did a command k after launching it to erase that buffer. After some reading I found an apple script that was suggested that you could add to your .profile:


osascript -e 'tell application "System Events" to keystroke "k" using command down'


That looks promising. I may try it later, but the clear command I added to my .bashrc seems to work fine for my purpose, although I don't know if that would come back to bite me later if I try and run something. I do have a better understanding of what scrollback is now though.


Not the greatest of problems but it does make the terminal look really busy seeing all that history.


Thanks again for your response Bob,


Tim

Terminal.app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.