public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tui/28887] New: colored prompt length not calculated correctly
@ 2022-02-13 16:58 seanga2 at gmail dot com
  2022-02-13 17:01 ` [Bug tui/28887] " seanga2 at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: seanga2 at gmail dot com @ 2022-02-13 16:58 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28887
           Summary: colored prompt length not calculated correctly
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: seanga2 at gmail dot com
  Target Milestone: ---

When using gdb with a colored prompt such as

set prompt \033[31mgdb$ \033[0m

the length of the prompt will include the non-visible escape codes. This can be
demonstrated by entering a long command:

gdb$ some long command

and then pressing UP and HOME (or C-P and C-A). The cursor will be placed on
the space after "long," instead of on the s in "some", as expected.
Additionally, if one presses DOWN (C-N), "some long" will remain at the
beginning of the command. Despite this, the cursor is "logically" at the
beginning of the command, which can be seen by editing the command and
inspecting the history.

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
@ 2022-02-13 17:01 ` seanga2 at gmail dot com
  2022-02-13 17:47 ` schwab@linux-m68k.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: seanga2 at gmail dot com @ 2022-02-13 17:01 UTC (permalink / raw)
  To: gdb-prs

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

seanga2 at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |11.1

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
  2022-02-13 17:01 ` [Bug tui/28887] " seanga2 at gmail dot com
@ 2022-02-13 17:47 ` schwab@linux-m68k.org
  2022-02-13 17:50 ` seanga2 at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2022-02-13 17:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
You can use \1 and \2 to mark the start and end of invisible characters.  gdb
should perhaps support the \[\] brackets like bash.

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
  2022-02-13 17:01 ` [Bug tui/28887] " seanga2 at gmail dot com
  2022-02-13 17:47 ` schwab@linux-m68k.org
@ 2022-02-13 17:50 ` seanga2 at gmail dot com
  2022-02-17 16:17 ` ssbssa at sourceware dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: seanga2 at gmail dot com @ 2022-02-13 17:50 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from seanga2 at gmail dot com ---
Thanks!

Is this documented anywhere?

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
                   ` (2 preceding siblings ...)
  2022-02-13 17:50 ` seanga2 at gmail dot com
@ 2022-02-17 16:17 ` ssbssa at sourceware dot org
  2022-02-17 16:32 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ssbssa at sourceware dot org @ 2022-02-17 16:17 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #3 from Hannes Domani <ssbssa at sourceware dot org> ---
https://sourceware.org/gdb/onlinedocs/gdb/gdb_002eprompt.html says it supports
\[\], but \1\2 are not listed there.

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
                   ` (3 preceding siblings ...)
  2022-02-17 16:17 ` ssbssa at sourceware dot org
@ 2022-02-17 16:32 ` schwab@linux-m68k.org
  2022-02-17 16:35 ` ssbssa at sourceware dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2022-02-17 16:32 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
That works with the python interface, but not with set prompt.

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
                   ` (4 preceding siblings ...)
  2022-02-17 16:32 ` schwab@linux-m68k.org
@ 2022-02-17 16:35 ` ssbssa at sourceware dot org
  2022-02-17 17:15 ` schwab@linux-m68k.org
  2023-05-26 16:12 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ssbssa at sourceware dot org @ 2022-02-17 16:35 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Hannes Domani <ssbssa at sourceware dot org> ---
The prompt docu [1] points to the python prompt docu for the list of acceptable
escape sequences.

[1] https://sourceware.org/gdb/onlinedocs/gdb/Prompt.html

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
                   ` (5 preceding siblings ...)
  2022-02-17 16:35 ` ssbssa at sourceware dot org
@ 2022-02-17 17:15 ` schwab@linux-m68k.org
  2023-05-26 16:12 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2022-02-17 17:15 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Andreas Schwab <schwab@linux-m68k.org> ---
So far the theory.

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

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

* [Bug tui/28887] colored prompt length not calculated correctly
  2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
                   ` (6 preceding siblings ...)
  2022-02-17 17:15 ` schwab@linux-m68k.org
@ 2023-05-26 16:12 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2023-05-26 16:12 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
I've build gdb 11.1 (both with packaged readline (8.1) and system readline
(7.0) in case this matters) and I can't reproduce this.

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

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-13 16:58 [Bug tui/28887] New: colored prompt length not calculated correctly seanga2 at gmail dot com
2022-02-13 17:01 ` [Bug tui/28887] " seanga2 at gmail dot com
2022-02-13 17:47 ` schwab@linux-m68k.org
2022-02-13 17:50 ` seanga2 at gmail dot com
2022-02-17 16:17 ` ssbssa at sourceware dot org
2022-02-17 16:32 ` schwab@linux-m68k.org
2022-02-17 16:35 ` ssbssa at sourceware dot org
2022-02-17 17:15 ` schwab@linux-m68k.org
2023-05-26 16:12 ` 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).