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

Re: PATCH: Run builtins, functions, etc. under zpty



On Nov 5, 10:37pm, Bart Schaefer wrote:
}
} This patch copies code from the clone module into newptycmd(), so that the
} forked process set up on the pty is initially a clone of the current shell.
} Then instead of calling execve(), the command can be parsed and executed
} with execode().

I forgot that this requires a change to nslookup.

Also, I committed a tweak to newptycmd() after sending the patch in 13123,
to unset `interactive' in the cloned shell before calling execode().  This
seems like the right thing to do; the clone itself isn't interactive any
more, even if the command it's eval'ing probably is, and it prevents the
saving of history or sourcing of .zlogout should an `exec' or `exit' be
performed in the clone.  (Patch for that not included here, it's in CVS.)

Index: Functions/Misc/nslookup
===================================================================
@@ -24,7 +24,7 @@
     [[ -z "$pager" ]] && pager="${opager:-more}"
 (( $#pmpt )) || pmpt=(-p '> ')
 
-zpty nslookup nslookup "$@"
+zpty nslookup command nslookup "${(q)@}"
 
 zpty -r nslookup line '*
 > '

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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