You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "no1wudi (via GitHub)" <gi...@apache.org> on 2023/02/01 14:15:08 UTC
[GitHub] [nuttx] no1wudi opened a new pull request, #8399: stdio: Echo char if getline from stdin
no1wudi opened a new pull request, #8399:
URL: https://github.com/apache/nuttx/pull/8399
## Summary
Some getline based REPL apps can't see the input in the nsh. For this case, if we are reading a line from stdin, echo the character to stdout can fix it.
## Impact
getline only
## Testing
WAMR REPL application
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] no1wudi commented on a diff in pull request #8399: stdio: Echo char if getline from stdin
Posted by "no1wudi (via GitHub)" <gi...@apache.org>.
no1wudi commented on code in PR #8399:
URL: https://github.com/apache/nuttx/pull/8399#discussion_r1093921439
##########
libs/libc/stdio/lib_getdelim.c:
##########
@@ -235,6 +266,7 @@ ssize_t getdelim(FAR char **lineptr, size_t *n, int delimiter,
#ifdef HAVE_GETLINE
ssize_t getline(FAR char **lineptr, size_t *n, FAR FILE *stream)
{
- return getdelim(lineptr, n, EOLCH, stream);
+ return getdelimx(lineptr, n, EOLCH, stream,
+ stream == stdin ? stdout : NULL);
Review Comment:
Yes, after reading the docs of termios, the serial driver should handle this behavior (configurable by termios).
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8399: stdio: Echo char if getline from stdin
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8399:
URL: https://github.com/apache/nuttx/pull/8399#discussion_r1093559804
##########
libs/libc/stdio/lib_getdelim.c:
##########
@@ -235,6 +266,7 @@ ssize_t getdelim(FAR char **lineptr, size_t *n, int delimiter,
#ifdef HAVE_GETLINE
ssize_t getline(FAR char **lineptr, size_t *n, FAR FILE *stream)
{
- return getdelim(lineptr, n, EOLCH, stream);
+ return getdelimx(lineptr, n, EOLCH, stream,
+ stream == stdin ? stdout : NULL);
Review Comment:
how to handle redirect? the echo should be handled by serial driver, I think.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] no1wudi closed pull request #8399: stdio: Echo char if getline from stdin
Posted by "no1wudi (via GitHub)" <gi...@apache.org>.
no1wudi closed pull request #8399: stdio: Echo char if getline from stdin
URL: https://github.com/apache/nuttx/pull/8399
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org