dhylands / usb-ser-mon

Auto connect to USB Serial devices.
MIT License
48 stars 29 forks source link

Non blocking read #9

Closed kapacuk closed 3 years ago

kapacuk commented 3 years ago

When usb_ser_mon is waiting for the USB device to be connected, it's impossible to terminate it with Ctrl-X because it's using sys.stdin.read() in the waiting mode. This change replaces sys.stdin.read with os.read, making it possible to recognise Ctrl-X and terminate gracefully.