Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

interact




I recieved no response to my question about how to turn control
over to a user for an interactive session part way through running
a zsh script, in the same way that you can in the expect language.

Ive looked at the source and it would seem that the command

	source /dev/tty

will do most of what I want (except give a prompt and have the
zle command line editting work).

I have 2 options....

	1. special case the command 'source /dev/tty' to set the
	   options INTERACTIVE and SHINSTDIN before the tty is
	   read in the source function in utils.c. You will still
	   get the original behavour using 'source //dev/tty'.


	2. allow the source (and .) built-ins to accept a -i flag,i.e.
			source -i /dev/tty
	   to force it into a fit state for an interactive session.
	   This involves small modifications  to the source function in
	   utils.c and to the bin_dot function in builtins.c.

There is a slight variation is option 1 and that is to special case
'source /dev/xxxxx', whatever xxxxx may be. 

I have implemented both versions to try them out and Im happy with
them all. I would welcome any comments.

To put this in its historical context.... this is not the first time
that I've wished to run a script setting up various functions and
variables and then wanted to pass control to the user. I find that
my only existing solution is clumsy.

			Anthony.



Messages sorted by: Reverse Date, Date, Thread, Author