public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/30346] New: [gdb/cli] CLI in ansi terminal has off-by-one width problem
@ 2023-04-13 12:42 vries at gcc dot gnu.org
  2023-04-15  6:10 ` [Bug cli/30346] " vries at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2023-04-13 12:42 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30346

            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=xterm 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=ansi 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=40, then ask readline how wide
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-12  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 12:42 [Bug cli/30346] New: [gdb/cli] CLI in ansi terminal has off-by-one width problem vries at gcc dot gnu.org
2023-04-15  6:10 ` [Bug cli/30346] " vries at gcc dot gnu.org
2023-04-21 15:12 ` cvs-commit at gcc dot gnu.org
2023-05-05 12:34 ` cvs-commit at gcc dot gnu.org
2023-05-12  9:43 ` cvs-commit at gcc dot gnu.org
2023-05-12  9:46 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).