Re: [PATCH] histedit: When editing, use `el_set` with `EL_PROMPT_ESC` rather than `EL_PROMPT`.

Herbert Xu <[email protected]> Sat, 16 Nov 2024 19:24:17 +0800
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
sebastien peterson boudreau <[email protected]> wrote:
> As can be seen in the `man` page for `el_set`, using `EL_PROMPT_ESC` for
> the op is the same as `EL_PROMPT`, but it allows escape characters to be
> expanded in the prompt the same way they are when used with `echo` or
> `printf(1)`.
> 
> As far as I know, this is not specified by POSIX, but neither is the
> emacs editing mode (please correct me if I am wrong), so I think this is
> a justified change to make it align with the behaviour or `echo` and
> `printf(1)`.
> 
> Given that this is not specified by POSIX, there isn't much of a
> precident for what the value of the start/stop character should be. From
> what I have seen, 0o001 is common, so that is what I have included in
> the patch, but it may not be the most fitting. Taking a look at how
> ASCII defines its control characters, I believe any characters between
> 0o034 and 0o037 may be a more suitable choice, but this could be up for
> debate.
> 
> Signed-off-by: Sebastien Peterson-Boudreau
> <[email protected]>
> ---
> src/histedit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt