Luciano
Luciano

Reputation: 2999

Terminal emulator scroll buffer doesn't keep ncurses screens

A system using the default curses library from AIX had the following behavior: Each time the screen was cleaned and rewritten, the old screen was kept by the terminal emulator in its scroll buffer, so you could scroll back, each screen just before its cleanup.

Now, using the ncurses 6, and maybe some modifications (we cannot know if there were changes in the original code), all terminal emulators doesn't keep the old screen anymore.

Are there anything that we cold do (programmaticaly, settings, ...) to ensure or to allow emulators to keep the screens in their scroll buffers before they are cleaned?

Upvotes: 0

Views: 428

Answers (1)

Thomas Dickey
Thomas Dickey

Reputation: 54563

What you're describing is more likely the terminal description, rather than the curses library. However, you do not appear to be describing the alternate screen feature (both AIX and ncurses use that for xterm's description).

By default, if you compiled ncurses it will use its own terminal database. It can be configured (compile-time) to use the same binary format as AIX, and you could in that case set TERMINFO_DIRS to point to AIX's terminal database first.

The INSTALL file in the sources tells you this (packagers are of course expected to read that file):

--with-caps=XXX
    Specify an alternate terminfo capabilities file, which makes the
    configure script look for "include/Caps.XXX".  A few systems, e.g.,
    AIX 4.x use the same overall file-format as ncurses for terminfo
    data, but use different alignments within the tables to support
    legacy applications.  For those systems, you can configure ncurses
    to use a terminfo database which is compatible with the native
    applications.

The Caps.aix4 file works with later versions of AIX, for instance.

AIX's system terminal database is /usr/share/lib/terminfo, and applications compiled with its curses library would look there. ncurses' TERMINFO_DIRS variable gives it a list of places to look (and is ignored by AIX curses).

One drawback to using AIX's terminal database is that it is essentially SVr3 with some minor tweaks, and doesn't handle line-drawing correctly (specifically it doesn't assume that sgr0 resets line-drawing mode). So using one terminal database with the other library (either is possible if ncurses is configured as suggested) makes some applications misbehave when they do line-drawing. But setting it up this way would let you compare the terminal descriptions and see which feature is causing your problem.

Upvotes: 0

Related Questions