Pico W : WebREPL : Ctrl-C not working
Discussed in https://github.com/orgs/micropython/discussions/11532
<div type='discussions-op-text'>
<sup>Originally posted by villeneuve May 17, 2023</sup>
Hi!
With latest 1.20 (also tested with today nightly build) pressing Ctrl-C in WebREPL on a pico W that is running a program has no effect.
Ctrl-C works in normal REPL but not in WebREPL
On ESP8266 and ESP32 (latest 1.20 as well) it works as expected in WebREPL
And also (on the pico W) webrepl_setup exits on error because there is no boot.py file.
We can just create an empty one and it works but this isn't obvious for beginers (boot.py exists on ESP* ports)
</div>
RP2 (Pi Pico W) WebREPL: Keyboard interrupts during time.sleep ignored.
On the RP2 port, keyboard interrupts received via the WebREPL appear to be buffered and ignored during calls to time.sleep.
To reproduce, run the following one-liner via the WebREPL and immediately attempt to interrupt it using Ctrl+C:
>>> import time; time.sleep(10)
When using the WebREPL, instead of interrupting the sleep, the sleep continues for the full ten seconds. After the sleep ends, a number of empty prompts are printed indicating that the keyboard interrupts were buffered rather than ignored.
Keyboard interrupts do work when sent via the regular serial terminal.
I have seen keyboard interrupts work in this setting on other platforms' WebREPLs, e.g. I've also tested this on an ESP8266 also running MicroPython 1.21. As such, I believe this issue may be port-specific.
- Firmware version: RPI_PICO_W-20231005-v1.21.0.uf2
- Board: Pi Pico W
- Version info string:
MicroPython v1.21.0 on 2023-10-06; Raspberry Pi Pico W with RP2040