zsh-workers
 help / color / mirror / code / Atom feed
* read -e does not restore terminal settings correctly when interrupted if
@ 2014-12-21  4:16 Mehran Kholdi
  2014-12-21  4:26 ` Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: Mehran Kholdi @ 2014-12-21  4:16 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

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
<https://lists.gnu.org/archive/html/bug-bash/2014-09/msg00029.html>:

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.


Thanks a lot for the awesome zsh,
-- Mehran

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: read -e does not restore terminal settings correctly when interrupted if
  2014-12-21  4:16 read -e does not restore terminal settings correctly when interrupted if Mehran Kholdi
@ 2014-12-21  4:26 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2014-12-21  4:26 UTC (permalink / raw)
  To: Mehran Kholdi; +Cc: zsh workers

On Sun, Dec 21, 2014 at 5:16 AM, Mehran Kholdi <kholdi.mehran@gmail.com> 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
> <https://lists.gnu.org/archive/html/bug-bash/2014-09/msg00029.html>:
>
> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-21  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-21  4:16 read -e does not restore terminal settings correctly when interrupted if Mehran Kholdi
2014-12-21  4:26 ` Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).