Hello all,

I originally reported this issue to the msys2 team:
But I find that this issue is coming from Cygwin Bash, so I'm reporting

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?

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