From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D70C3858D33; Thu, 13 Apr 2023 12:42:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D70C3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681389749; bh=FLDwkCYHdD9CvINVq7vgISjoPi4m1bMPU07ZhREh7ew=; h=From:To:Subject:Date:From; b=Tw7etOirjOmkLPtPMhalLWyhse8VDf2zWQMCEw4fRUg5S9mInycgnFYnon+Te6Yyq 7/5l7G88/xLfAvcx6wbM1B0ugZ1LsPE6HIOsgIBsSqQfac4KQ5QnVXhoa+PIBhSgit fEDnVvQAuD//PV22ZhrgLkOOEtIgLaaokjuo5bS8= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug cli/30346] New: [gdb/cli] CLI in ansi terminal has off-by-one width problem Date: Thu, 13 Apr 2023 12:42:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30346 Bug ID: 30346 Summary: [gdb/cli] CLI in ansi terminal has off-by-one width problem Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: cli Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- [ Previously filed at PR30337 comment 3. ] Say we have a terminal with: ... $ echo $COLUMNS 40 ... For contrast, lets start with the terminal in xterm mode, and type 'a' for a while: ... $ TERM=3Dxterm gdb -q 1 2 3 4 1234567890123456789012345678901234567890 (gdb) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aa ... All 40 positions in the line are used, before we wrap to the next line. Now we start gdb with the terminal in ansi mode: ... $ TERM=3Dansi gdb -q 1 2 3 4 1234567890123456789012345678901234567890 (gdb) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aa ... The line wraps after 38 chars. Based on the readline behaviour of hiding one char to deal with the lack of autowrap, we'd expect wrapping after 39 chars. The problem is that we start out with COLUMNS=3D40, then ask readline how w= ide the screen is, which replies 39. Then we use the 39 to set the screensize using readline, which results in an effective width of 38. --=20 You are receiving this mail because: You are on the CC list for the bug.=