Mail Archives: djgpp/1997/12/26/12:48:55
I just joined the list today myself, but a "rookie" like me can
handle these questions. ;-) The topics are probably better addressed
in other newsgroups however.
> 1. Where can I find a list of escape sequences for unix
> (like: "^[J2" - clear the screen)?
Those ANSI escape sequences for cursor control of the screen can be
found in various places on various systems. If going through the Web
search engines doesn't turn up anything then
(1) On most, if not all, Unix systems, terminal capabilities are
found in a file in the /etc directory. This file is called
"termcap". I suggest you do "man termcap" at the shell prompt to
understand the codes for the booleans, number values, and string
values both for input and output of a terminal. Also try "man
terminfo": there is an attempt to make this a more preferred system
for defining terminal capabilities. A termcap-style source file (a
terminfo file--you can generally convert from termcap to terminfo
with a utility called "captoinfo").
(2) On DOS, Microsoft has something you can read by typing
"help ansi.sys" at the DOS prompt (assuming you are using MS-DOS 5.0
or later version). Those will describe a minor set of ANSI escape
codes.
> 2. Is there any portable function or asm code for reading one
> single character from the console? (with DOS, I can use BIOS
> interrupt 16h, but with unix I can't, as far as I understand
> it).
I don't believe you can use the word "portable" and "asm" in the same
sentence (or breath). I can say that with Unix, you need to play
around with the termios structures to get single character input and
the like. These are well-described in FAQs in the Unix groups
(obtainable through the web or ftp too). I am attempting to get my
own curses/menus/forms/term code taken from a SysVR4 system and set
up a wrapper to implement those things that can be done in MS-DOS and
ignore those things that cannot. Note that use of interrupts is
a property of a processor and not an operating system. Someone
running a Unix system on a Motorola 68xxx would take offense at your
notion that all they have to do is call interrupt 0x16 :)
Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara TURKEY
mitch AT duzen DOT com DOT tr
other job title: Sequoia's (dob 12-20-95) daddy
- Raw text -