From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13069 invoked by alias); 21 Dec 2014 04:26:28 -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: 34027 Received: (qmail 14561 invoked from network); 21 Dec 2014 04:26:26 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=W/136Eag3zoU7hD+bXQ9i7yucodTHMwnoDZRkz5SPRk=; b=BFFROPK3lHLqnAIjM1YqME4YTjYgXMlCUfVcdfThNx+7ufMLiyrVDuTHHxQHxsH8En HgTqA2QrpKxQcFd0LYuA9nGmiISU0hAG5Yafiz5JfPHIhKvok36sfClIbLTR5VxgeugD tOh3xEL2yfXFsbjToWH2XGqqD+VixqjkychV3WZY5MACNKcaJqkafKs2MC+2gByy85mn RwKmIRHN1C9p8ZjIK66kD2KETGL2JDDF2IBkEzg+YvRh87GeGkFZLCt5YG4NsvI8fU4D PD00EGaBKetFeo+CLJDgISaUt7LCp70pXSlevCRM57KunZg334CDBC9443EFVeT7Uc76 C7LQ== MIME-Version: 1.0 X-Received: by 10.50.80.36 with SMTP id o4mr10410676igx.37.1419135982348; Sat, 20 Dec 2014 20:26:22 -0800 (PST) In-Reply-To: References: Date: Sun, 21 Dec 2014 05:26:22 +0100 Message-ID: Subject: Re: read -e does not restore terminal settings correctly when interrupted if From: Mikael Magnusson To: Mehran Kholdi Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Sun, Dec 21, 2014 at 5:16 AM, Mehran Kholdi wrote: > Hi Zsh guys! > > There's a bug in bash that causes inconvenience for zsh users only, > apparently. I don't know why it has been there for so long, given there is > a patch for it already. Do you think there's a way to work around this in > zsh instead? > > An excerpt from the original bug > : > > Given the following script (test.sh) : >> #!/bin/bash >> cleanup() { :; } >> trap cleanup 0 >> read -e dummy >> Run the script ('bash test.sh') *in ZSH* and when it waits for an >> input, interrupt it with Ctrl-C. Your terminal is now messed-up. This can >> be verified by running 'cat >> -t' and pressing Enter. ^M will be printed instead of a newline and >> password >> prompts such as the one in sudo cannot be submitted by pressing Enter >> anymore. I can't reproduce the issue, but you could try running ttyctl -f before running the buggy program, and zsh should restore all tty settings after every command (including stty). -- Mikael Magnusson