[riot-notifications] [RIOT-OS/RIOT] sys/shell: cancel current line on CTRL-C. (#11004)

Juan I Carrano notifications at github.com
Tue Feb 12 15:59:46 CET 2019


### Contribution description

Just like in a regular UNIX terminal, control-C now cancels the current line.  This is a suggestion of @benemorius.

This is useful if one is using a dumb terminal to communicate with a node, as it saves having to repeatedly type backspace to discard the current line. It also helps when connecting to an already running node,
as one does not know what is on the line buffer, the safest thing to do is to begin by sending a ctrl-C.


### Testing procedure

I have included a test. It should work both on a board or in native:

```
$ cd tests/shell
$ BOARD=samr21-xpro make all
$ BOARD=samr21-xpro make flash
$ BOARD=samr21-xpro make test
```

If testing by hand:

- On a board, be sure to use a terminal that forwards ctrl-C, otherwise you will not be testing the thing. This means _no_ pyterm.
- On native, use Ctrl-V+ctrl-C to insert a literal ETX, otherwise you will be sending a SIGINT.

### Issues/PRs references

Depends on #11003 for testing.
Part of #10994 .
Split from #10788 .
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11004

-- Commit Summary --

  * tools/serial.inc.mk: Support miniterm.py.
  * tests/shell: use tuple instead of dictionary in test scripts.
  * tests/shell: Test cancelling a line with ctrl-C.
  * sys/shell: cancel current line on CTRL-C.

-- File Changes --

    M makefiles/tools/serial.inc.mk (5)
    M sys/shell/shell.c (6)
    M tests/shell/Makefile (5)
    M tests/shell/tests/01-run.py (43)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11004.patch
https://github.com/RIOT-OS/RIOT/pull/11004.diff

-- 
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/11004
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190212/76af853e/attachment.html>


More information about the notifications mailing list