bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] Invisible characters in prompt


From: Chet Ramey
Subject: Re: [Bug-readline] Invisible characters in prompt
Date: Sat, 3 Sep 2016 21:50:47 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 9/3/16 5:13 PM, Tony Lewis wrote:
> I call readline with a prompt such as "\033[0m\033[0;1;34mmode>\033[0m
> \033[1m", which on my VT100-compatible terminal displays "mode>" in blue
> and makes the user's input bold. There are 21 characters that are not
> visible to the user. When I press the up arrow to move backward through the
> history, it will display the lines of history OK for a while and then
> suddenly it will shift the first character of the history line 21
> characters to the right. The same thing can happen when I use CTRL+A to
> move to the start of the line. I have confirmed that readline does not have
> the same problem if I call it with a prompt of "mode> ".

This is from the description of rl_expand_prompt():


Applications may indicate that the prompt contains characters that take
up no physical screen space when displayed by bracketing a sequence of
such characters with the special markers @code{RL_PROMPT_START_IGNORE}
and @code{RL_PROMPT_END_IGNORE} (declared in @file{readline.h}).  This may
be used to embed terminal-specific escape sequences in prompts.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]