shell preprocessor for history & alias

Geoff Kuenning geoff at desint.UUCP
Tue Jan 8 15:49:37 AEST 1985


In article <6986 at brl-tgr.ARPA> cottrell at nbs-vms.ARPA writes:

>okay, bizarre idea time. how about
>writing a filter that only does aliases & history & pipes the transformed
>output to sh! so far so good, *but* then interactive progs like vi (yes,
>its in sys v) won't run because they attempt to do ioctl/stty on a pipe.
>this means i have to save the stdin fd & exec vi directly. any suggestions,
>comments? maybe i can get a rise out of chris at md on this one.

This is easy to do if you have pseudo-tty's.  My machine has these even though
I don't have networking (this is a fortuitous side effect), and I normally run
my normal tty through a program that talks to 4 pseudo-tty's (poor man's job
control).  It would not be hard to replace it with a fancy screen-oriented
guy that managed windows, kept history, and the whole bit, for all terminal
interactions.

One advantage of this sort of approach is that tty settings become associated
with the subject process, rather than the tty.  After all, why should my
cat's be screwed up just because I ran vi?  And why should vi have to go to a
lot of work to put the tty back the way cat wants it, every time I send it a
SIGTSTP?

One problem is the massive-input problem:  When I am editing, I *don't* want
history (the features of a good editor are much more useful than a history of
edit commands), and I most certainly don't want my two hours of entering code
to wipe out my command history.
-- 

	Geoff Kuenning
	...!ihnp4!trwrb!desint!geoff



More information about the Comp.unix.wizards mailing list