dist/tools/pyterm: handle ctrl+d nicely

This commit is contained in:
Alexandre Abadie 2018-04-17 17:09:36 +02:00
parent 2350c46740
commit 75dba75fbb

View File

@ -288,6 +288,12 @@ class SerCmd(cmd.Cmd):
"""
self.ser.write("help\n".encode("utf-8"))
def do_EOF(self, line):
"""Handle EOF (Ctrl+D) nicely."""
self.logger.debug("Received EOF")
self.do_PYTERM_exit("")
sys.exit(0)
def complete_date(self, text, line, begidx, endidm):
"""Auto completion for date string.
"""