zsh-workers
 help / color / mirror / code / Atom feed
From: "Peter A. Castro" <doctor@fruitbat.org>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: zsh-workers@zsh.org
Subject: Re: Possible ZSH bug with IO direction
Date: Mon, 25 Apr 2016 10:16:58 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1604251005380.6490@ming.fruitbat.org> (raw)
In-Reply-To: <20160424200132.7d0d00bc@ntlworld.com>

On Sun, 24 Apr 2016, Peter Stephenson wrote:

> Date: Sun, 24 Apr 2016 20:01:32 +0100
> From: Peter Stephenson <p.w.stephenson@ntlworld.com>
> To: zsh-workers@zsh.org
> Subject: Re: Possible ZSH bug with IO direction

Greetings, Peter S.
   I'm the author of the offending Cygwin pre-main hook, so you can
squarely level any complains about it at me.  I'm also the maintainer of
the Cygwin port, for whatever that's worth.  :)

> On Sun, 24 Apr 2016 11:36:44 -0700
> Bart Schaefer <schaefer@brasslantern.com> wrote:
>> On Apr 24,  1:17pm, Peter Stephenson wrote:
>> }
>> } Mounting the filesystem within Cygwin as binary works here.
>>
>> Really?  That contradicts what the main.c comment asserts.
>
> So it seems like "binary" isn't quite what it's cracked up to be.

No, it's not.  Neither is "text" mode. :)

> The alternative might be to do something similar in the lower levels of
> zsh, i.e. map \r\n to \n when reading shell input.  If done in input.c
> it's no worse than doing it in the OS abstraction, and doesn't affect
> fd's used by othe programmes.

   I tried to put this kind of specific control (O_TEXT) only in input.c 
(and a few other places), but there are too many places in the code that 
just "know" line-termination is 1 character and either loop trying to read 
more input or simply choke on the difference in size read vs. size 
expected.  It quickly became dozens of source modules affected and still I 
wasn't catching them all.
   I never really got it to work fully and just gave up, putting in the 
pre-main hook as a band-aid until some better solution presented itself. 
Really, the code needs to understand CR+LF.
   I lacked the time to fully understand all of the Zsh code so never went 
back to try and create a proper fix.  Some guidance on this would be 
welcome.

> pws

-- 
--=> Peter A. Castro
Email: doctor at fruitbat dot org / Peter dot Castro at oracle dot com
 	"Cats are just autistic Dogs" -- Dr. Tony Attwood


  parent reply	other threads:[~2016-04-25 17:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23 18:30 Roger Qiu
2016-04-23 22:14 ` Bart Schaefer
2016-04-24 12:17   ` Peter Stephenson
2016-04-24 18:36     ` Bart Schaefer
2016-04-24 19:01       ` Peter Stephenson
2016-04-24 21:23         ` m0viefreak
2016-04-25  9:12           ` Peter Stephenson
2016-04-25 17:25           ` Peter A. Castro
2016-04-24 21:53         ` Bart Schaefer
2016-04-25  8:46           ` Peter Stephenson
2016-04-25 21:12           ` Mikael Magnusson
2016-04-25 17:16         ` Peter A. Castro [this message]
2016-04-24 17:08   ` Roger Qiu
2016-04-24 18:35     ` Bart Schaefer
2016-04-25 17:31       ` Peter A. Castro
2016-04-25 17:47         ` Bart Schaefer
2016-04-25 18:14           ` Peter A. Castro
2016-04-26  9:16             ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1604251005380.6490@ming.fruitbat.org \
    --to=doctor@fruitbat.org \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).