Path: utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!tut.cis.ohio-state.edu!husc6!m2c!umvlsi!vishwana
From: vishwana@umvlsi.ECS.UMASS.EDU (Chidambaram Vishwanath)
Newsgroups: comp.unix.questions
Subject: How to mimic the terminal driver?
Message-ID: <35@umvlsi.ECS.UMASS.EDU>
Date: 29 Nov 88 17:22:01 GMT
References: <10566@wsgw.ws.sony.junet>
Reply-To: vishwana@umvlsi.ECS.UMASS.EDU (Chidambaram Vishwanath)
Organization: University of Massachusetts, Amherst
Lines: 27


     I have taken upon myself the following task, viz.,: I want to add 
an extra feature to the C-shell whereby I can recall earlier commands
by pressing an arrow-key.  I thought first of using 'stty' to
reconfigure the arrow key to be an interrupt key, and then program the
shell to trap the interrupt and process it appropriately. But very 
quickly I discovered that the command-line shell cannot be interrupted.

	So I thought of another possible approach. A program would 
interpose between a child c-shell and the terminal. This program would
take characters from the terminal and deliver them to the shell.(Both
my program and the shell are running in the foreground, connected by a
pipe.)  However here is where I ran into another problem.  How to 
return the end_of_file condition to the reading shell?  For instance,
the 'command-completion' facility in the C-shell depends upon the user
hitting '^D' after entering some text.  My program can detect the eof,
but how is it to communicate it to the shell to which it is connected?

	I will be grateful for any pointers towards solving this
problem, or comments as to the feasibility of the whole approach alto-
gether.

			Thank you,
					Vishwanath,
					University of Mass. at Amherst.
e-mail: vishwana@umaecs (BITNET)
        vishwana@ecs.umass.edu (CSNET)