Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Stop Terminal From Clearing Previous Output

Stop Terminal From Clearing Previous Output
Thread Tools
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Feb 13, 2004, 05:57 AM
 
I apologize for asking this question, since I know I already read it somewhere on the forums. I'm wondering how to prevent Terminal from clearing the output of a program just quit. For example, display top and then press q. The buffer is cleared and the only thing displayed is a blank prompt. This wasn't the way Jaguar's terminal acted, so I'd like to restore the functionality.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Mac Enthusiast
Join Date: Nov 2001
Location: Adelaide, South Australia
Status: Offline
Reply With Quote
Feb 17, 2004, 11:27 PM
 
One way is to change your TERM environment variable from "xterm-color" to "vt100".
The vt100 setting isn't too bad, so not much is lost. So if you're using bash or zsh just

export TERM=vt100

in one of your initialization files, and if you're using tcsh just use

setenv TERM vt100

in your .login file.

Cheers,
Paul
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Feb 18, 2004, 08:08 AM
 
Originally posted by Big Mac:
... For example, display top and then press q. The buffer is cleared and the only thing displayed is a blank prompt. ...
You could also run the command:

top -l 1

And get a single screenful of top dumped to the terminal or, alternatively, to a file.

top -L n

Where n is the number of process lines you want to display is also handy.
-DU-...etc...
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 18, 2004, 02:58 PM
 
Or use your mouse, highlight and copy the part you're interested in and paste it after you quit top.

-
     
Fresh-Faced Recruit
Join Date: Sep 2002
Location: London
Status: Offline
Reply With Quote
Feb 21, 2004, 07:06 PM
 
Paul has the right idea if you want the same behaviour as Jaguar:
One way is to change your TERM environment variable from "xterm-color" to "vt100".
But you can just go to the Terminal->Preferences pane and select 'vt100' from the popup list to do exactly the same thing.

It isn't just 'top' that is affected, so is 'man' and anything that uses 'less'.

If you want to keep the 'xterm-color' there are ways of preventing it clearing the window for these applications. For bash, you can put:
Code:
export LESS='-XRse'
in .login, or for tcsh:
Code:
setenv LESS '-XRse'
But I'm not sure if this helps with 'top'.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:47 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2