Re: [PATCH v2] Cache the expanded prompt for editline

2021-01-14 Thread June Bug
> On Jan 14, 2021, at 15:12, Herbert Xu wrote: > > OK, in that case I think it's best to fix this in libedit instead. Huh? There’s no issue in libedit, only unclear documentation. The application is the right place to store the prompt: it can be in a static buffer, or a constant string, in

Re: [PATCH v2] Cache the expanded prompt for editline

2021-01-14 Thread Herbert Xu
On Thu, Jan 14, 2021 at 10:43:21AM -0500, June Bug wrote: > > It seems unlikely given the lack of consistency of when libedit > calls the prompt callback. I only noticed it was happening when I > patched in support for EL_RPROMPT (right-aligned prompts), which > when active causes libedit to call

Re: [PATCH v2] Cache the expanded prompt for editline

2021-01-14 Thread June Bug
> On Jan 13, 2021, at 01:18, Herbert Xu wrote: > > What if someone actually wanted the prompt to change? It seems unlikely given the lack of consistency of when libedit calls the prompt callback. I only noticed it was happening when I patched in support for EL_RPROMPT (right-aligned prompts),

Re: [PATCH v2] Cache the expanded prompt for editline

2021-01-12 Thread Herbert Xu
C. McEnroe wrote: > Previously, the prompt would be expanded every time editline called the > getprompt callback. I think the code may have been written assuming that > editline only calls getprompt once per prompt, but it may actually call > it many times, for instance every time you type