From 4f5adbd34698c507e3aa842a213613d455211fac Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Thu, 6 Aug 2026 09:27:45 -0300 Subject: [PATCH] system/readline: Fix espace sequence returning to user console This commit fixes the issue: https://github.com/apache/nuttx-apps/issues/3680 Signed-off-by: Alan C. Assis Assisted-by: Claude Code --- system/readline/readline_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c index 1642e035e..872fcf768 100644 --- a/system/readline/readline_common.c +++ b/system/readline/readline_common.c @@ -1598,7 +1598,10 @@ ssize_t readline_common(FAR struct rl_common_s *vtbl, FAR char *buf, buf[cursor] = (char)ch; nch++; cursor++; # ifdef CONFIG_READLINE_ECHO - redraw_tail(vtbl, buf, nch, cursor); + if (cursor < nch) + { + redraw_tail(vtbl, buf, nch, cursor); + } # endif } #else