This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fhandler_tty deadlock patch


First off, this patch does fix the large paste problem.  Thanks for this!

However, there are a couple of problems with this patch.  For example,
this makes bash run from a command prompt (or a shortcut) treat every
character as a ^D.  Bash run from an xterm/rxvt works fine.  /bin/sh
ignores Enter (or ^J, or ^M).  Running 'bash -c "echo BLAH && exit"' from
a command prompt works, however, running "bash -c 'echo BLAH && exit'
results in

C:\cygwin\bin>bash -c 'echo BLAH && exit'
'exit'' is not recognized as an internal or external command,
operable program or batch file.


and "bash -c 'echo BLAH && exit '" (with a space after exit) echoes BLAH
and exits the originating command prompt.  Putting any character after the
space results in the same behavior.  I'm attaching an strace of bash
running under command with this problem.

Adding 'tty' to CYGWIN doesn't affect the outcome.  Setting TERM to
'cygwin' in xterm/rxvt doesn't reproduce the problem - this only happens
in a command shell.

I'm unable to track this down further.  Hope this helps.  Please let me
know if you need any additional info.

On Fri, 18 Oct 2002, Steve O wrote:

> Hi,
> This patch solves some deadlock issues which would prevent
> terminal programs such as rxvt and xterm from being able
> to handle large pastes or cat binary files.
> The fix involves two mechanisms, adding a buffer for
> termios echoing, and allowing a pty_master write to
> write less than the entire buffer.
> There is one small bug remaining that I know of.  When the
> pty_slave changes from cooked to raw, the master doesn't seem to
> know to flush the line edit buffer until a key is pressed.
> Should be an easy fix, but I'm not sure how to best do it.
> -steve

      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51

Attachment: steve_o-paste-bash.strace.bz2
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]