scrip + history = cmdline history ??????

Dave Shepperd shepperd at dms.UUCP
Mon Jun 5 08:26:47 AEST 1989


>From article <614 at tapa.UUCP>, by larry at tapa.UUCP (Larry Pajakowski):
> 
> Under DOS this is easy to handle since the application uses DOS i/o for cooked
> and BIOS and/or direct screen write for raw i/o.  Xenix/Unix on the other hand
> uses ioctl calls to do this.  How could a program like script which uses pty's
> figure out when to buffer keystrokes for the cooked input or get out of the
> way for the raw input?
> 

I've written a command line editor with history as a line discipline which
makes it application independent. The line discipline is what does the
"cooking" of keyboard input. What the disciplines do to distinguish cooked
and raw modes is to inspect the flags in the tty structure. If certain bits
are set, then it assumes cooked mode. If certain bits are clear, it assumes
raw mode and steps aside. The same line discipline routines are used by
"real" terminal drivers as well as pseudo terminal drivers. This technique,
easy to do in kernel code, my be somewhat difficult to use in a user
program, but not impossible. It would require an ioctl to get the tty stats
at various places and times which might bring your system to its knees.


-- 

Dave Shepperd.	    shepperd at dms.UUCP or weitek!dms!shepperd
Atari Games Corporation, Sycamore Drive, Milpitas CA 95035.
(Arcade Video Game Manufacturer, NOT Atari Corp. ST manufacturer).



More information about the Comp.unix.xenix mailing list