This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: bash: igncr shell option breaks my PS1 prompt
- From: Gene Pavlovsky <gene dot pavlovsky at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 2 Sep 2016 14:52:40 +0300
- Subject: Re: bash: igncr shell option breaks my PS1 prompt
- Authentication-results: sourceware.org; auth=none
- References: <CAPTiy3PE0gZ-hpvQbxVkfaZfxtppDx7RG85WtuigpnL54WZbDA@mail.gmail.com> <CAPTiy3N-n5krtWcZuK8-pBQE_efzroS6rizknHqU2tE+BYaMQQ@mail.gmail.com> <8980687a-967e-88d8-2a94-f485731fafe9@redhat.com> <9940d9b9cd565fbb0d5b395565197dfd@xs4all.nl> <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