Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Matt Rice <ratmice@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [python] [patch] set/show extended-prompt
Date: Fri, 12 Aug 2011 15:40:00 -0000	[thread overview]
Message-ID: <m3mxfe63kq.fsf@redhat.com> (raw)
In-Reply-To: <m3r54qlm3b.fsf@redhat.com> (Phil Muldoon's message of "Fri, 12	Aug 2011 15:51:20 +0100")

Phil Muldoon <pmuldoon@redhat.com> writes:

> Matt Rice <ratmice@gmail.com> writes:
>
>> On Thu, Aug 11, 2011 at 8:06 AM, Phil Muldoon <pmuldoon@redhat.com> wrote:
>>
>>> +@item @var{\e}
>>> +Substitute an ESC character.
>>
>>> +def _prompt_esc(attr):
>>> +    "The ESC character."
>>> +    return '\033'
>>
>> won't usage of this (without an equivalent to bash's \[ \]) mess up
>> the prompt width calculation?
>> maybe something like...
>
> Not sure what you mean by width in this context.  I checked strlen and
> for /efoo/e and it reported the length at five?

We talked a little about this on irc.  In the submitted case, readline
is counting the actual \e as a character, so when it re-displays a prompt
it calculates the prompt length incorrectly (including the ESC).  Matt's
approach nullifies this.  I'll adjust the patch, documentation and tests
accordingly

Cheers,

Phil.

>> @item @var{\[}
>> Begins a sequence of non-printing characters.
>> @item @var{\]}
>> Ends a sequence of non-printing characters.
>>
>> def _prompt_nonprinting_begin(attr):
>>    "Begins a sequence of non-printing characters."
>>    return '\001'
>>
>> def _prompt_nonprinting_end(attr):
>>    "Ends a sequence of non-printing characters."
>>    return '\002'


  reply	other threads:[~2011-08-12 15:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 15:07 Phil Muldoon
2011-08-11 16:21 ` Eli Zaretskii
2011-08-11 18:01   ` Phil Muldoon
2011-08-11 18:22     ` Eli Zaretskii
2011-08-11 21:42 ` Matt Rice
2011-08-12 14:51   ` Phil Muldoon
2011-08-12 15:40     ` Phil Muldoon [this message]
2011-08-12 20:22 ` Tom Tromey
2011-08-12 22:20   ` Phil Muldoon
2011-08-13  6:27     ` Eli Zaretskii
2011-08-15 14:03   ` Phil Muldoon
2011-08-15 16:58     ` Eli Zaretskii
2011-08-16 11:22       ` Phil Muldoon
2011-08-16 13:39         ` Eli Zaretskii
2011-08-17 11:02           ` Phil Muldoon
2011-08-15 17:51     ` Tom Tromey

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=m3mxfe63kq.fsf@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ratmice@gmail.com \
    /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