[riot-notifications] [RIOT-OS/RIOT] sys/shell: Exit the shell on ctrl-D (#10788)
Juan I Carrano
notifications at github.com
Fri Sep 20 17:55:20 CEST 2019
One thing I must point out is that ctrl-D handling in native and on serial based targets is different (and that should be fixed some day).
Native uses the terminal in cooked mode, so it will never see the ctrl-d, instead it sees an EOF.
Embedded targets use what would be the equivalent of raw mode, thus seen ctrl-d, ctrl-c, etc as what they are (though depending on the terminal program you are using you may have to use Ctrl-V to prevent it from being interpreted by your *local* machine).
IMO this discrepancy should be fixed, and native should be setting up the terminal to behave as close to the UART as possible (raw mode, no buffering, no echo) using `tcsetattr` and friends.
All this being said, it may make sense to differentiate between the stream being closed and a ctrl-d (maybe do a `feof()` before returning from shell_run? or add an additional code to handle_input_line?) and change the return type of shell run to allow it to report this.
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