readline: Make prompt-caching available

readline cached the current prompt only when TAB completion was enabled,
even though line-editing redraws also depend on that cached prompt.
With TAB completion disabled, full-line redraws erased the prompt and
repainted only the command buffer. Make the prompt cache available
whenever line editing is enabled.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
Alan C. Assis 2026-07-22 09:26:32 +00:00 committed by Alan C. Assis
parent 893f0c31ee
commit 48eb95998b
3 changed files with 28 additions and 16 deletions

View file

@ -223,7 +223,7 @@ int nsh_session(FAR struct console_stdio_s *pstate,
write(OUTFD(pstate), nsh_prompt(), strlen(nsh_prompt()));
#ifdef CONFIG_READLINE_TABCOMPLETION
#if defined(CONFIG_READLINE_TABCOMPLETION) || defined(CONFIG_READLINE_EDIT)
/* Set the prompt so readline can redraw it for editing features */
readline_prompt(nsh_prompt());