From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16429 invoked by alias); 20 Feb 2012 16:41:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30240 Received: (qmail 17498 invoked from network); 20 Feb 2012 16:41:49 -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, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Mon, 20 Feb 2012 16:35:57 +0000 From: Peter Stephenson To: Subject: Re: suspend (^Z) behavior while a function is running is unclear Message-ID: <20120220163557.672588e2@pwslap01u.europe.root.pri> In-Reply-To: <20120220160944.GC7797@xvii.vinc17.org> References: <20120220130259.GB7797@xvii.vinc17.org> <20120220151309.4cc1a83d@pwslap01u.europe.root.pri> <20120220160944.GC7797@xvii.vinc17.org> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.101.10.170] X-Scanned-By: MailControl 7.6.6 (www.mailcontrol.com) on 10.68.0.162 On Mon, 20 Feb 2012 17:09:45 +0100 Vincent Lefevre wrote: > Now I'm thinking whether there should be an option to control that. > Indeed, some functions may fail to work correctly if they are suspended > in such a way. Some functions or { list } could be marked as not > backgroundable, e.g. by setting an option at the beginning, in which > case the ^Z could be ignored. Useful, but I'm not sure an option is the right way of doing this... I should think you'd want to do something like: { stty susp undef ... } always { stty susp '^z' } which you could encapsulate as nosuspend() { { stty susp undef "$@" } always { stty susp '^z' } } compdef _precommand nosuspend except you can do better by saving and restoring the setting. A library module for manipulating terminal settings using parameters (which you can make local) might be an interesting project for someone with nothing better to do. (By the way, I'm wondering how many of the other shells simply execute to the end of the parent function when they see the "emacs" process suspended?) -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog