Abhishekmishra2808 commented on code in PR #3714:
URL: https://github.com/apache/nuttx-apps/pull/3714#discussion_r3767972872


##########
nshlib/nsh_session.c:
##########
@@ -103,6 +103,18 @@ int nsh_session(FAR struct console_stdio_s *pstate,
     }
 #endif /* CONFIG_NSH_TELNET_LOGIN */
 
+#ifdef CONFIG_SCHED_USER_IDENTITY
+  if (login != NSH_LOGIN_NONE)
+    {
+      nsh_update_prompt();
+
+#  if defined(CONFIG_NSH_READLINE) && \
+      (defined(CONFIG_READLINE_TABCOMPLETION) || defined(CONFIG_READLINE_EDIT))
+      readline_prompt(nsh_prompt());

Review Comment:
   When readline isn’t enabled (CONFIG_NSH_CLE), we only need 
nsh_update_prompt() in the command loop, which passes nsh_prompt() to cle_fd() 
/ write() on each line. readline_prompt() is only for the readline+tab/edit 
case where readline caches the prompt internally. I can align the #if with the 
main loop if you prefer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to