.comment-link {margin-left:.6em;} <$BlogRSDURL$>

Friday, June 23, 2006

GNU Screen - disable xterm alternate screen 

By default, if you run gnu screen in an xterm (or any "alternate screen buffer"-capable terminal), any text that scrolls off the top of the screen will not be visible if you try to scroll back in your host terminal.

You can of course use the gnu screen scroll commands to scroll around in the virtual terminal, but i find that using my mac's scrollbars is much more convenient.

The easiest way to disable the alternate screen buffer in gnu screen, you can put the following in your ~/.screen.rc file:

# Disable xterm alternate screen buffer
termcapinfo * ti@:te@


The "termcapinfo" command is used to tweak host and virtual terminal settings.   "ti" and "te" are termcap entries used to enter and exit the alternate buffer (man termcap or terminfo for more details).  The @ symbol tells screen to turn off the specified entries.

Note that if you do this, your alternate buffer will be disabled in both your host and virtual terminals.  So if previously you used vi to edit a file and the contents of the file disappeared when you quit vi, this will no longer be the case.

Comments: Post a Comment


This page is powered by Blogger. Isn't yours?