From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB5533857410; Mon, 27 Jun 2022 01:48:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB5533857410 From: "jonathan.poelen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106098] New: error message that uses ANSI codes that can cause characters to disappear Date: Mon, 27 Jun 2022 01:48:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jonathan.poelen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 01:48:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106098 Bug ID: 106098 Summary: error message that uses ANSI codes that can cause characters to disappear Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jonathan.poelen at gmail dot com Target Milestone: --- Created attachment 53204 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53204&action=3Dedit comparison between a 106 and 127 column terminal int main() { char const* b =3D "" + ""; } $ g++ -fdiagnostics-color=3Dalways test.cpp test.cpp: In function =E2=80=98int main()=E2=80=99: test.cpp:2:22: error: invalid operands of types =E2=80=98const char [1]=E2= =80=99 and =E2=80=98const char [1]=E2=80=99 to binary =E2=80=98operator =E2=80=99 [...] On a terminal of 106 characters per line, the `+` sign disappeared. This is= due to the use of the ANSI code \x1b[K which normally removes the characters to= the right of the cursor. However, many terminals make the last character of the line disappear when this code is used at the end of the line. This is the c= ase here with a 106 column terminal ($COLUMNS=3D106). I don't know why \x1b[K is used, but as far as I can see, it is useless.=