Hi Nathan,
Yes, same happens to duktape prompt:
$ ./nuttx
login: admin
password:
User Logged-in!
nsh> duk
((o) Duktape 2.5.0 (v2.5.0)
duk> hheellpp
ReferenceError: identifier 'help' undefined
at [anon] (duktape/src-noline/duktape.c:83732) internal
at global (input:1) preventsyield
duk>
It was caused by recent carry return modifications.
BR,
Alan
On 4/24/23, Nathan Hartman <[email protected]> wrote:
> I am having some trouble understanding how NSH_TELNET is supposed to
> work in NuttX now. It used to work for me on real hardware.
>
> I saw that some people had problems because of not synchronized nuttx
> and apps repos, because some PRs were merged at different times. My
> nuttx and apps are both based on latest master.
>
> Recently (last couple of weeks?) there were some PRs in both repos
> related to telnet, CR/LF, CLE, or I don't know what, and the behavior
> changed:
>
> Now, when I type, I see double characters, and they get mixed up, and
> also seem to change with some delay. For example, if I type 'help':
>
> [[[
>
> $ telnet 192.168.10.100
> Trying 192.168.10.100...
> Connected to 192.168.10.100.
> Escape character is '^]'.
>
> NuttShell (NSH)
> nsh> hehehelp
>
> ]]]
>
> Typing 'help' and pressing Return does not work: Momentarily I see ^M
> when I press Return but it is replaced by duplicated characters of
> 'help' and the help does not print.
>
> Typing 'help' followed by Ctrl+J instead of Return does work and the
> help does print, but there is garbage displayed momentarily.
>
> If I change telnet mode to 'line' instead of 'character', it works
> better, but then I see each line of input echoed a second time. For
> example, notice how I type 'help' + Return and I see "helphelp usage"
> on the next line:
>
> [[[
>
> $ telnet 192.168.10.100
> Trying 192.168.10.100...
> Connected to 192.168.10.100.
> Escape character is '^]'.
>
> NuttShell (NSH)
> nsh> ^]
> telnet> mode line
>
> nsh> help
> helphelp usage: help [-v] [<cmd>]
>
> . basename dd exit ifup nslookup set
> uname
> [ break delroute false kill printf sleep
> umount
> ? cat df free ls ps source
> unset
> addroute cd dmesg help mkdir pwd test
> uptime
> alias cp echo hexdump mkrd rm time
> usleep
> unalias cmp env ifconfig mount rmdir true
> xd
> arp dirname exec ifdown mv route truncate
>
> Builtin Apps:
> telnetd morsecode sh ping tmutil
> ostest renew netcat nsh
> nsh>
>
> ]]]
>
> If telnet is working for you, what telnet program are you using and
> what telnet settings do you have?
>
> Thanks,
> Nathan
>