From da6010909143334e345dea39e9a5be8e72038dbe Mon Sep 17 00:00:00 2001 From: Peter van der Perk Date: Fri, 31 Jul 2026 15:44:52 +0200 Subject: [PATCH] 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 --- src/systemcmds/nshterm/nshterm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/systemcmds/nshterm/nshterm.cpp b/src/systemcmds/nshterm/nshterm.cpp index 84a4a6ed41a..ab6fbdc5e1c 100644 --- a/src/systemcmds/nshterm/nshterm.cpp +++ b/src/systemcmds/nshterm/nshterm.cpp @@ -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]);