[Bug] CLI freezes on serial port monitoring commands with espflash monitor

Resolved 💬 2 comments Opened Feb 6, 2026 by shreyashguptas Closed Feb 6, 2026

Bug Description
I have a repository where Claude is working, and that is writing code that then gets flashed to an ESP32 microcontroller. Sometimes, I ask Claude to look at the serial logs coming from the USB and check if everything is working fine, but at times, when it runs the following command, the entire Claude code and my ESP just freeze, and I can do nothing other than having to restart my physical hardware and Claude code. Only then can I continue, and it freezes every single time without fail.

Logs copied:
❯ check the ESP and see what is going on. If everything is working fine.

⏺ Bash(source $HOME/export-esp.sh && espflash monitor -p /dev/cu.usbmodem114301 2>&1)
⎿  Error: Exit code 1
[2026-02-06T17:01:10Z INFO ] Serial port: '/dev/cu.usbmodem114301'
[2026-02-06T17:01:10Z INFO ] Connecting...
[2026-02-06T17:01:11Z INFO ] Using flash stub
Commands:
CTRL+R Reset chip
CTRL+C Exit

Error: × Failed to initialize input reader

⏺ The interactive monitor doesn't work in this terminal. Let me read the serial output directly.

⏺ Bash(stty -f /dev/cu.usbmodem114301 115200 cs8 -cstopb -parenb && timeout 10 cat /dev/cu.usbmodem114301
2>&1 || true)
⎿  zsh: command not found: timeout 10 cat /dev/cu.usbmodem114301

✢ Wibbling… (9s · ↑ 163 tokens)

──────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ 
──────────────────────────────────────────────────────────────────────────────────────────────────────────
⏵⏵ accept edits on (shift+tab to cycle) · 1 file +2 -2 · esc to interrupt · ctrl+t to hide tasks 87612
toke
ns
curre
nt: 2
.1.34
· la
test:
2.1.
34

Environment In…
Note:** Content was truncated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗