[riot-notifications] [RIOT-OS/RIOT] sys/shell: cancel current line on CTRL-C. (#11004)
Juan I Carrano
notifications at github.com
Mon Mar 4 15:44:00 CET 2019
I'm realising now that this is __not__ the best way to implement this feature (it is now wrong either.)
The right thing to do here would be to implement a sort of ["line discipline"](http://www.linusakesson.net/programming/tty/index.php) in `stdio_uart`. It would be the correct place to implement:
- line buffering
- dropping the line on ctrl-c (or sending a message/flag to some "foreground thread". I'm not saying it should do that, but if someone wants the feature like @benemorius then this is the place to put it.)
- [Sending a partially completed line (even an empty one) on ctrl-D](https://utcc.utoronto.ca/~cks/space/blog/unix/TypingEOFEffects).
Of course, `stdio_uart` would get bigger and more complex but it would probably get offset by the decrease in complexity of the shell code that handles this at the moment. In addition to that, the functionality would be available to any shell command (for free) and if it is considered too heavy, an alternative implementation of `stdio_uart` without the magic can be provided.
By the way, the line discipline is the place to put stuff like ethos/slip (this is what's done in unix) though ideally in a separate module and not patched with #ifdefs.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications