Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.7: Disable alternate screen use in xterm terminals UNIX
In Lion the xterm terminal settings have been updated and now emacs, vi, less, pine, and more, among others use the 'alternate screen' feature in which the screen is cleared after the process quits. Here is a way to restore the previous behaviour, in which the final screen remains in the scrollback.

I found this in a post by Chris Johnsen, who explains how it works.

For example let us suppose that you are using the default terminal: xterm-256color. (See Terminal.app>>Preferences>>Settings>>Advanced.) At the command line type:

infocmp | sed -e 's/[sr]mcup=[^,]*,//' > /tmp/noaltscreen-terminfo

Press Return and then type:

tic -o ~/.terminfo/ /tmp/noaltscreen-terminfo

This creates a file ~/.terminfo/78/xterm-256color in your home directory. When you open a new Terminal.app window the local file is used, while other users get the default Lion behavior.

[crarko adds: I haven't tested this one. In the referenced post above it is also suggested that the command man something | more will accomplish the same effect just for man pages without changing the overall behavior of the terminal.]
    •    
  • Currently 3.50 / 5
  You rated: 2 / 5 (6 votes cast)
 
[4,674 views]  

10.7: Disable alternate screen use in xterm terminals | 5 comments | Create New Account
Click here to return to the '10.7: Disable alternate screen use in xterm terminals' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Disable alternate screen use in xterm terminals
Authored by: boxcarl on Sep 12, '11 12:24:33PM

I now get this error message:

bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `exec -la (null) (null)'

And the terminal instantly quits. Any help?



[ Reply to This | # ]
10.7: Disable alternate screen use in xterm terminals
Authored by: boxcarl on Sep 12, '11 12:27:34PM

Went back to status quo by running:

$ infocmp > /tmp/altscreen-terminfo 
$ tic -o ~/.terminfo/ /tmp/altscreen-terminfo 
Edited on Sep 12, '11 12:28:16PM by boxcarl


[ Reply to This | # ]
10.7: Disable alternate screen use in xterm terminals
Authored by: goblyn13 on Sep 12, '11 07:05:10PM

Much easier way to fix this. Is add to your .profile (yes include the leading dot ".")

export TERM=vt100

Will solve the problem by forcing yor xterms to follow vt100 behaviour rather than xterm.



[ Reply to This | # ]
10.7: Disable alternate screen use in xterm terminals
Authored by: feold3 on Sep 13, '11 07:06:17AM

Or simply change the the "Declare terminal as:" setting at: Terminal.app>>Preferences>>Settings>>Advanced



[ Reply to This | # ]
10.7: Disable alternate screen use in xterm terminals
Authored by: mingo on Sep 13, '11 06:00:08PM
Perhaps I wasn't so clear. This hint is for those who wish to use xterm-256color instead of vt100, which only gives you black and white. xterm-256color lets you use 256 colours (approximately) in your terminal window.

It seems that the X11 paradigm was to have a separate window for each process, so it made sense to use the alternate screen system. For Terminal.app this isn't always convenient.

[ Reply to This | # ]