public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "seanga2 at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tui/28887] New: colored prompt length not calculated correctly
Date: Sun, 13 Feb 2022 16:58:43 +0000	[thread overview]
Message-ID: <bug-28887-4717@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2022-02-13 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13 16:58 seanga2 at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28887-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).