Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Termcap/terminfo Message-ID: <9290@mimsy.UUCP> Date: Tue, 10-Nov-87 19:42:23 EST Article-I.D.: mimsy.9290 Posted: Tue Nov 10 19:42:23 1987 Date-Received: Fri, 13-Nov-87 03:55:14 EST References: <846@quacky.UUCP> <847@quacky.UUCP> <6625@brl-smoke.ARPA> <3059@psuvax1.psu.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 42 Xref: mnetor comp.unix.wizards:5419 comp.unix.questions:4872 In article <3059@psuvax1.psu.edu> flee@gondor.psu.edu (Felix Lee) writes: >Anyone want to know the semantics of xenl/xn? Perhaps terminfo defines this better. In termcap, unfortunately, `xn' does not describe cursor positioning when a character is printed at the end of a line. Instead, it merely says that the terminal is guaranteed to eat a newline that is printed immediately after that character, and that once this is done, the cursor will then be at the beginning of the next line. Why does this matter? Here is an example. I once wrote a screen management package (the Maryland Window Library, for those of you with long memories). I wanted to be able to write the last character of each line, including the last line. To do this I must know whether the cursor will advance and the screen will scroll. Termcap does not tell me. There exist terminals on which writing the last character of any line immediately wraps the cursor to the beginning of the next (possibly scrolling), after which the terminal consumes one newline without action. There are others on which writing the last character of any line puts the cursor in a `virtual' position, such that the *next* printing character (if any) prints in the first column of the next line, moving the cursor to column 2 of that line. On the second kind of terminal, a newline printed while the cursor is in its virtual column moves it to column 1 of the next line (possibly scrolling). `:am:xn:' describes both. Alas!, `xn' is tied deeply to the implementation of the editor vi: vi's response to `xn' is simply to print a newline, feeding the terminals that consume one and scrolling those that do not. This is fine for vi; it wants the screen to scroll. I do not. I want to distinguish between these two kinds of `am' terminals---the one that scrolls immediately and the one where I can move the cursor to prevent scrolling---but termcap does not tell. (If anyone cares, my Window Library assumes that `xn' describes the terminal with the virtual column. The code *is* 5 years old: I know better now, but have not the time to fix it.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris