[riot-notifications] [RIOT-OS/RIOT] sys/shell: Exit the shell on ctrl-D (#10788)

Martine Lenders notifications at github.com
Thu Sep 19 08:58:48 CEST 2019


> Does wrapping the shell in a while loop solve everyone's concerns with exiting on ^D?

So this is how `shell_run()` currently looks like:

https://github.com/RIOT-OS/RIOT/blob/711854562b77e2c9165942f9dc1a3ecef32dc8d0/sys/shell/shell.c#L293-L310

Currenlty, ^D is just ignored (`handle_input_line()` sees `*pos <= ' '` so nothing happens). The functionality introduced here causes the function to go into the if condition and break that loop. Adding another while loop around the existing while loop however would have the same behavior, just with another while loop around: Hitting ^D would finish the inner while loop, the outer while loop would then cause another iteration of the inner while loop. So I don't really get the point of having this then except for the `handle_input_line()` not being entered.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10788#issuecomment-532995648
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190918/a8e9b546/attachment.htm>


More information about the notifications mailing list