Discussion:
[Bug gdb/21689] New: artifacts in prompt rendering when using colors
hi-angel at yandex dot ru
2017-06-28 15:47:16 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

Bug ID: 21689
Summary: artifacts in prompt rendering when using colors
Product: gdb
Version: 8.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: hi-angel at yandex dot ru
Target Milestone: ---

Steps to reproduce:

1. Start "gdb -nh"
2. Type "set prompt \033[31mgdb λ \033[0m", press enter.
3. Press Ctrl+R, type "hello"
4. Press <Tab>

Result: you'll see the word "hello" at the prompt, even though there's actually
nothing.

FTR: found by using this gdbinit
https://github.com/gdbinit/Gdbinit/blob/master/gdbinit which is very popular.
Surprising that nobody reported.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-04-01 17:34:58 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Please try "set extended-prompt" instead, with the special sequences
indicating the non-printing characters.
--
You are receiving this mail because:
You are on the CC list for the bug.
hi-angel at yandex dot ru
2018-04-01 17:55:24 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

--- Comment #2 from Hi-Angel <hi-angel at yandex dot ru> ---
(In reply to Tom Tromey from comment #1)
Post by tromey at sourceware dot org
Please try "set extended-prompt" instead, with the special sequences
indicating the non-printing characters.
Well, it indeed clears the prompt correctly, but unfortunately using "set
extended-prompt \033[31mgdb λ \033[0m" results in the "\033" seen as letters
instead of being converted to colors.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-04-02 02:19:25 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Try this instead:

(gdb) set extended-prompt \[\e[31m\]gdb λ \[\e[0m\]


You can see the available escapes using "help set extended-prompt"
--
You are receiving this mail because:
You are on the CC list for the bug.
hi-angel at yandex dot ru
2018-04-02 05:41:07 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

--- Comment #4 from Hi-Angel <hi-angel at yandex dot ru> ---
(In reply to Tom Tromey from comment #3)
Post by tromey at sourceware dot org
(gdb) set extended-prompt \[\e[31m\]gdb λ \[\e[0m\]
You can see the available escapes using "help set extended-prompt"
Jesus Christ, this is amazing, it works! It does even work with "echo hello"
like in the other bug you commented on!
--
You are receiving this mail because:
You are on the CC list for the bug.
hi-angel at yandex dot ru
2018-04-02 05:43:28 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

--- Comment #5 from Hi-Angel <hi-angel at yandex dot ru> ---
(In reply to Hi-Angel from comment #4)
Post by hi-angel at yandex dot ru
(In reply to Tom Tromey from comment #3)
Post by tromey at sourceware dot org
(gdb) set extended-prompt \[\e[31m\]gdb λ \[\e[0m\]
You can see the available escapes using "help set extended-prompt"
Jesus Christ, this is amazing, it works! It does even work with "echo hello"
like in the other bug you commented on!
Ah, nvm about the other bug — I mistested. But the problem at hands it does
solve!
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-15 14:20:43 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=21689

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...