Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.unix.programmer Subject: Re: Questions about rewriting the History function. Message-ID: Date: 31 Oct 90 23:21:12 GMT References: <1990Oct21.220115.9458@watdragon.waterloo.edu> <4288@altos86.Altos.COM> Sender: news@OSF.ORG Followup-To: comp.unix.programmer Organization: Open Software Foundation Lines: 32 In-reply-to: ti@altos86.Altos.COM's message of 23 Oct 90 23:34:23 GMT In article <4288@altos86.Altos.COM> ti@altos86.Altos.COM (Ti Kan) writes: | In <1990Oct19.165721.7584@polyof.poly.edu>, mhoffman@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 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@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?