bash: igncr shell option breaks my PS1 prompt

Houder houder@xs4all.nl
Tue Aug 30 20:50:00 GMT 2016


On 2016-08-30 15:40, Eric Blake 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.

Not only \n ... also on \r:

64-@@ bash --version
GNU bash, version 4.3.46(6)-release (x86_64-unknown-cygwin)
...

64-@@ set -o igncr
64-@@ echo $SHELLOPTS
braceexpand:emacs:hashall:histexpand:history:igncr:ignoreeof:interactive-comments:monitor
64-@@ PS1='$(date)\n# '
bash: command substitution: line 1: syntax error near unexpected token 
`)'
bash: command substitution: line 1: `date)'

# PS1='$(date)\r# '
bash: command substitution: line 1: syntax error near unexpected token 
`)'
bash: command substitution: line 1: `date)'

HOWEVER:

# PS1='$(date)\012# '
Tue Aug 30 19:36:15 CEST 2016
# PS1='$(date)\012\n# '  # <==== \n!
Tue Aug 30 19:36:21 CEST 2016

# PS1='$(date)\012\r# '  # <==== \r!
Tue Aug 30 19:36:26 CEST 2016
#

Perhaps this may help ... in finding the error.

Henri

--
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



More information about the Cygwin mailing list