Hello all,

I originally reported this issue to the msys2 team:
https://github.com/msys2/MSYS2-packages/issues/1839
https://github.com/msys2/MSYS2-packages/pull/4477
But I find that this issue is coming from Cygwin Bash, so I'm reporting
here.

When I use \n after command substitution in $PS1, it causes syntax errors
when the igncr option is set:
```
$ set -o igncr
$ PS1='$(date)\n\$ '
-bash: command substitution: line 1: syntax error near unexpected token `)'
-bash: command substitution: line 1: `date)'
```
(Confirmed with bash-5.2.21-1)

I found an issue in rewind_input_string() in parse.y. It didn't take care
of '\r'.
Please find the attached patch to fix it.
Could you consider merging this into bash-5.2-cygwin.patch?

Regards,
Ken Takata

Attachment: bash-5.2-cygwin-fix-igncr.patch
Description: Binary data

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

Reply via email to