fix(systemcmds/nshterm): echo input and consume enter

Enable ICANON and ECHO, and map CR to NL (ICRNL) so the nshterm console
echoes typed characters and processes the enter key.

Co-authored-by: marinauterion <224611774+marinauterion@users.noreply.github.com>
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
This commit is contained in:
Peter van der Perk
2026-08-12 10:47:29 +02:00
co-authored by marinauterion
parent 21898b028e
commit f4cc18b976
+2
View File
@@ -85,6 +85,8 @@ extern "C" __EXPORT int nshterm_main(int argc, char *argv[])
/* Set ONLCR flag (which appends a CR for every LF) */
uart_config.c_oflag |= (ONLCR | OPOST);
uart_config.c_iflag |= ICRNL;
uart_config.c_lflag |= (ICANON | ECHO);
if ((termios_state = tcsetattr(fd, TCSANOW, &uart_config)) < 0) {
PX4_ERR("set config %s\n", argv[1]);