By default, FreeBSD's virtual terminals (sc and vt) don't restore previous terminal content when exiting from a full screen app. Is there a support for this functionality? I've tried following sequences:


but they clear the terminal (first one seems to start the alternate screen, and the second one to leave it, however it clears screen).

  • 1
    Looks like no, as after pkg install ncurses and then infocmp | grep -o '[sr]mcup[^,]*' with TERM=screen the proper escape sequences are shown, and will do the alternate screen thing over a SSH session, but will not in the console with the same TERM setting.
    – thrig
    Oct 12, 2015 at 18:58

2 Answers 2


In FreeBSD 10.2, neither syscons nor vt support an alternate display buffer. It is not implemented in teken.


No - sc and vt are not really xterm-compatible. Likewise teken. The first two are essentially cons25 (25-line "SCO-like" console), and the last you might call xterm-compromise. The notion behind teken was to lessen distress of people who happen to be on the console and ssh to some other machine where cons25 is unknown. It amends some of the function keys, and some of the screen-updating.

In ncurses, those have accurate terminal descriptions (with notes):

To get a better sense of the differences of teken from xterm, you might try running vttest, e.g.,

vttest 25x80.80

(to avoid getting distracted by the lack of support for 80/132-column switching). For validating the terminal descriptions, tack was more useful.

If those terminals had supported alternate screen, there would be a note in the terminal database, and (likely) the smcup and rmcup capabilities would be filled out to demonstrate it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .