[Top][All Lists]

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

Re: [Bug-readline] CSI sequences in prompt strings

From: Chet Ramey
Subject: Re: [Bug-readline] CSI sequences in prompt strings
Date: Sat, 3 Dec 2016 12:30:56 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.0

On 12/2/16 3:23 PM, LogicStuffs wrote:
> Setup: Readline 6.3, gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
> Identical behaviour with xterm and gnome-terminal.
> When I call readline with a prompt string containing CSI sequences and try
> to enter multiline input, and I get close before the end of the first line,
> the cursor is reset to the beginning of the line. Any more input then
> overwrites the prompt message, and then the previous input. After that, it
> is possible to fill the whole line with characters and get to the next
> line. Readline simply doesn't consider that not all of the prompt string's
> characters are printable.

This is from the description of rl_expand_prompt (which is called by
readline()) in the readline documentation:

"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]