public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Gene Pavlovsky <gene.pavlovsky@gmail.com>
To: cygwin@cygwin.com
Subject: Re: bash: igncr shell option breaks my PS1 prompt
Date: Fri, 02 Sep 2016 11:52:00 -0000	[thread overview]
Message-ID: <CAPTiy3Ow6b6n7Nfd+DHpfnw-W7Y_ZAXS4+CqQaX8BzsV=hhkow@mail.gmail.com> (raw)
In-Reply-To: <0294c48e-8e96-f554-3e05-6b7771dfb96e@redhat.com>

Dear Eric Blake,

I understand there were issues with read handling of \r. But is the
resulting solution/bugfix ideal? Or does it introduce new problems?

Basically, I don't want to set `igncr` as system-wide shell option
(e.g. through SHELLOPTS). I want to require scripts to use LF newlines
- if there's a script somewhere with CRLF newlines, I want it to break
immediately (which it would do by default, when igncr is disabled).
Then I will notice and convert it's newlines (dos2unix) right away.
So, how do I keep an existing bash script, that uses `read` piped from
the output of a Windows console program that uses CRLF as newlines,
working, without modifying the script? I don't see how it's possible
with the current situation.

Personally I think that by default read should behave as it did for
years. Backwards compatibility 101... Add a new shell option (separate
from igncr) if you'd like, but keep the default behavior same as it
was for a long time. How do you think?

Regards, Gene Pavlovsky

On 30 August 2016 at 16:40, Eric Blake <eblake@redhat.com> wrote:
> On 08/30/2016 02:49 AM, Houder wrote:
>> ... uhm ... what about the explanation in the help?
>>
>>       -o option-name
>>           Set the variable corresponding to option-name:
>>               ...
>>               igncr        on cygwin, ignore \r in line endings
>>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> ... this help message should be 'upgraded', should it not?
>
> Sure, I'll tweak that text, once I can find what about igncr is making
> PS1 misbehave on \n.  But help would be welcome, if anyone else is also
> interested in looking into the cygwin-specific patches and actually
> reviewing them.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2016-09-02 11:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27 16:20 Gene Pavlovsky
2016-08-27 18:31 ` Andrey Repin
2016-08-29  5:18 ` Gene Pavlovsky
2016-08-30  2:21   ` Eric Blake
2016-08-30  7:49     ` Andrey Repin
2016-08-30 16:57       ` Nellis, Kenneth
2016-08-30 17:38         ` Houder
2016-08-30 13:16     ` Houder
2016-08-30 17:04       ` Eric Blake
2016-08-30 20:50         ` Houder
2016-09-02 11:52         ` Gene Pavlovsky [this message]
2016-09-02 13:32           ` Eric Blake
2016-09-04  9:11             ` Gene Pavlovsky

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='CAPTiy3Ow6b6n7Nfd+DHpfnw-W7Y_ZAXS4+CqQaX8BzsV=hhkow@mail.gmail.com' \
    --to=gene.pavlovsky@gmail.com \
    --cc=cygwin@cygwin.com \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).