Questions about rewriting the History function.

Michael Meissner meissner at osf.org
Thu Nov 1 10:21:12 AEST 1990


In article <4288 at altos86.Altos.COM> ti at altos86.Altos.COM (Ti Kan)
writes:

| In <1990Oct19.165721.7584 at polyof.poly.edu>, mhoffman at george.poly.edu writes:
| > 
| > I am working on a senior project to rewrite the history function for
| > UNIX. My goal is to have the new history functon work like it does in
| > MS_DOS.  i.e. I want to be able to call up past commands and edit them
| > by using the control <hjkl> characters. Additionally, I would like to
| > write this as a stand alone program so that I do not have to rewrite
| > the shell.

	...

| Anyway, this will be difficult without incorporating the functionality
| into the shell.  You can't really intercept keyboard input with a user
| program before the shell gets it, unless you have a really weird
| tty driver.  Also, how do you distinguish shell commands from
| keystrokes typed during the run of an application?

Actually on BSD systems, it is somewhat straight forward.  You make
the history function be a pty master, and spawn the shell with the
slave pty as it's /dev/tty.  In fact's it was submitted to the
moderated group comp.sources.unix about 1-2 years ago.  Remember that
UNIX is not the same thing on all platforms -- if your system doesn't
have a useful feature, it doesn't necessarily mean that my system must
not have that feature.....
--
Michael Meissner	email: meissner at osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Do apple growers tell their kids money doesn't grow on bushes?



More information about the Comp.unix.programmer mailing list