From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6581 invoked by alias); 24 Feb 2015 19:18:34 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19916 Received: (qmail 4881 invoked from network); 24 Feb 2015 19:18:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, T_HDRS_LCASE,T_MANY_HDRS_LCASE autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=T/C1EZ6Q c=1 sm=1 tr=0 a=kPKDuYVJvYornGqTqrLWrw==:117 a=kPKDuYVJvYornGqTqrLWrw==:17 a=VNsaWKQvMhEA:10 a=IkcTkHD0fZMA:10 a=00MHFEVQNC-Ei1uahoUA:9 a=QEXdDO2ut3YA:10 Message-id: <54ECCE79.9050809@eastlink.ca> Date: Tue, 24 Feb 2015 11:18:17 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-version: 1.0 To: Zsh Users Subject: 'run ahead' execution of script Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit An interesting problem: e ) edit $1; echo "Sourcing $1"; source $1; return 0 ;; ... that line from a function does just what it seems, edit a file, then source it. 'edit' has been various editors over time. But I just tried changing 'edit' to 'geany', and something problematic happens: The message and the sourcing happen before geany is closed, but *only* if the editor is already open in another window. zsh is executing the rest of the line while the editor is still open, as if it thinks it should 'multitask' there. It seems logical that it doesn't close an editor that it didn't open, OTOH there's no point in sourcing the file before it has been edited. Can this be prevented? Again, I don't think that zsh should be expected to behave differently, however some way of forcing it to wait for the file (if not the entire editor) to be closed in this situation would be useful. Geany itself has an '-i' switch that forces a new process, but I'm wondering if zsh itself can handle that i.e. pause for a process to quit before continuing even if it didn't start it. I appreciate that this might be impossible-- a violation of the hierarchy. It's just a point of interest.