On Thu, Jan 21, 2010 at 04:32:23AM -0500, Roland Huss via RT wrote:
Show quoted text> Queue: Term-ReadLine-Perl
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=53792 >
>
> On Wed Jan 20 17:23:42 2010, nospam-abuse@ilyaz.org wrote:
> > On Wed, Jan 20, 2010 at 03:45:24AM -0500, Roland Huss via RT wrote:
> > > Actually I wouldn't mind to put the burden on the user. I.e. she is
> > responsible
> > > for mixing in the proper escapes when setting the prompt.
> >
> > My question was: how would user find the bracketing characters using
> > (only) the Term::Readline interface? (So that user's code has a
> > chance to work with different backends...)
>
> You are right, that the perfect solution where a user can semantically
> manage an *already* set RL prompt is really a heroic task (as you give in your
> examples).
>
> My assumption however was that for by far the most use cases the user is in
> complete control of the prompt and only sets this in TRl and never read it back.
> Within this model, he can prepare the prompt in a concise form for the specific backend in
> use.
Sorry, but I have very little interest in this scenario. If TR::Gnu
had provided an "only-through T::R solution" (i.e, not
backend-cognizant), I might be interested to support it in TRP. But
given that there is no pool of scripts which would suddently become
more usable due to my efforts, it looks this becomes quite a
theoretical exercise...
Show quoted text> The backend, though, needs to keep track about the brackets. If I understand right, you
> suggest to keep two copies of the prompt, the original one and a 'clean' version on which
> text manipulations are done.
I did not look in the code, but I think all I need is
sub prompt_screen_width ($);
sub prompt_substr_keep_all_0length_escapes($$$);
Show quoted text> printable characters in both versions of the prompt. But where,
> except for multi line prompts, do you need text manipulations for
> prompt handling ?
I recall that TRP does not use any fancy terminal escapes. Everything
is shown on one line. As a corollary, prompt is shortened if too long
for 1-line display.
Yours,
Ilya