DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 44N4Hx4X2667008 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=AoZQt4ro X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5673386C586 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1716437875; bh=sFVp7mrx573BskIPbvuIG1EdN/aHmpSU9Um78Pkw4BQ=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=AoZQt4roDb672G5vyCJlolQhu97rra7QrHjBbvPDbTxJAQwD6t2eo2o3UvGTWSyqx hdzAXZ5apFQZfHlPZejw6xZbP/cZe2NhOvaBe2oFBGGN7JiE2r0yMiuStExYkBQhue U1rQmuP0isNm43PpVxtaJCAhonzslpfaNxJrt9/w= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAD853858D26 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BAD853858D26 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716437820; cv=none; b=H+zSdBNBQ4sM3VK7J5TY6eKSx2DxmAOvf/hClM6djRdwwel9vlA+Y7VFdLBUydq5MRMk0IwcGWNfUk206R6mNXcnB3sxBP1p8UxMKqU1BpuaDxTE2qp4IsTLngTzZPWJ6rGqRdUNklKv3T2gGraI6IBCTx+j+X7fxhlrug5+MFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716437820; c=relaxed/simple; bh=PcMQAakPJKy4moPqMlv+F/sAtHcLvWzu86+U6BOfi2Y=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=iNrT/qNWVX6OyWSzwrUOjDoEbJOWFN5mMp7isee1If41CLFi28VULExEccIaO3LxQjgw+7y0wpVANiok40528mJTsK4VZJFnju+ol6e5t6K16KFqM9aH9kZASX5HzZLZnn8dyioe9ixPdJimhspsjfCIDohJdjNSi9iAJjGxaf0= ARC-Authentication-Results: i=1; server2.sourceware.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716437818; x=1717042618; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0FbGnoxH7DL2xT96qgM27V8DzPATOqkIohuW69w6puw=; b=TaRYI2RgZU3seZUYMlMkTgHJ/HGbmND4K2xWsxwyFDJI6GH0iQTzeTXzsrjQ3GiRsZ jMsPN4fLnL6M0LCLU0VEq3CeiWL8r4lQwul9pT45Dr5Pez8VQaMvFR9yLpsWNYH94whF 2cRmDzd0C8pbGvYtynrz0dwqXdj3pR9KxTneZkJp3zdrJ+3q7t41ixdKQkxBVCNKy/wn f8/Pvy9oxzlv0XAjaLQosrCUc4Tc024tHTLJPnzyZePwe49+NS4f95g62D2npoMcmr0D BB84JBpM9UEsDnkYlITU0KNXRQspMQli9v1JQq9lAJNW7aZBReQR4QHdgYGkj+MwladZ I90w== X-Gm-Message-State: AOJu0YyALqBD8XRId/5L2HYDx8PqQS+zWb0ujxpfAkgVkajLE1RuqTMl CbiU20Es3KB7wb58WCQx01AscDE0zwvmUg0u8S8XPBhEaR+dsgI4ezy2AwSQxjsuZdq+rBSuPL6 wCOWliS9UMjY9Gl9t7wPzkrVJUZ4oBiTj X-Google-Smtp-Source: AGHT+IH/efVhkTtpFQ6T8ENnpuwR8B3bGdhn/7C0W9evaYuxpdDB5n0xEZ9px7PZRaJU5Sl3iEGvy0tnDvLnLDV8lHs= X-Received: by 2002:a05:620a:343:b0:792:beac:88f4 with SMTP id af79cd13be357-79499438ed3mr410313685a.18.1716437817767; Wed, 22 May 2024 21:16:57 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 23 May 2024 13:16:46 +0900 Message-ID: Subject: bash: '\n' after command substitution in $PS1 causes errors when igncr is set To: cygwin AT cygwin DOT com Content-Type: multipart/mixed; boundary="00000000000068b34506191752af" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Ken Takata via Cygwin Reply-To: Ken Takata Sender: "Cygwin" --00000000000068b34506191752af Content-Type: text/plain; charset="UTF-8" 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 --00000000000068b34506191752af Content-Type: application/octet-stream; name="bash-5.2-cygwin-fix-igncr.patch" Content-Disposition: attachment; filename="bash-5.2-cygwin-fix-igncr.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lwiqg9880 LS0tIGEvcGFyc2UueQorKysgYi9wYXJzZS55CkBAIC0xNjg0LDcgKzE2ODQsMTYgQEAKICAgICAg aW50byBhY2NvdW50LCBlLmcuLCAkKC4uLlxuKSAqLwogICB4Y2hhcnMgPSBzaGVsbF9pbnB1dF9s aW5lX2xlbiAtIHNoZWxsX2lucHV0X2xpbmVfaW5kZXg7CiAgIGlmIChiYXNoX2lucHV0LmxvY2F0 aW9uLnN0cmluZ1stMV0gPT0gJ1xuJykKLSAgICB4Y2hhcnMrKzsKKyAgICB7CisgICAgICB4Y2hh cnMrKzsKKyNpZmRlZiBfX0NZR1dJTl9fCisgICAgICB7CisJZXh0ZXJuIGludCBpZ25jcjsKKwlp ZiAoaWduY3IgJiYgYmFzaF9pbnB1dC5sb2NhdGlvbi5zdHJpbmdbLTJdID09ICdccicpCisJICB4 Y2hhcnMrKzsKKyAgICAgIH0KKyNlbmRpZgorICAgIH0KIAogICAvKiBYWFggLSBob3cgdG8gcmVm bGVjdCBiYXNoX2lucHV0LmxvY2F0aW9uLnN0cmluZyBiYWNrIHRvIHN0cmluZyBwYXNzZWQgdG8K ICAgICAgcGFyc2VfYW5kX2V4ZWN1dGUgb3IgeHBhcnNlX2RvbHBhcmVuPyB4cGFyc2VfZG9scGFy ZW4gbmVlZHMgdG8ga25vdyBob3cK --00000000000068b34506191752af Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- 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 --00000000000068b34506191752af--