Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

espflash monitor takes over the terminal #681

Open
cacharle opened this issue Sep 16, 2024 · 5 comments
Open

espflash monitor takes over the terminal #681

cacharle opened this issue Sep 16, 2024 · 5 comments

Comments

@cacharle
Copy link

It happens often that I cannot kill espflash monitor with Ctrl-C or Ctrl-\ and the logs stop coming aswell. I'm not sure if my code crashed or if it's the connection to the device but it would be nice to have some error message or at least be able to kill the process instead of having to relaunch my terminal.

I use alacritty as a terminal btw:

❯ alacritty --version
alacritty 0.13.2 (bb8ea18e)
❯ espflash --version
espflash 3.1.0
@SergioGasquez
Copy link
Member

Seems similar to #464, I do use the same allacritty version on Linux and I don't recall encountering this issue.

@cacharle
Copy link
Author

My colleagues and I have observed that behavior across different terminals (Windows terminal, ubuntu's terminal, alacritty) and different machines with different OSes (Linux, Windows)

I really seems independent of the platform you're running on

@cacharle
Copy link
Author

cacharle commented Oct 4, 2024

Similar behavior when it cannot find a usb:

$ espflash monitor --log-format defmt --elf <elf>
[2024-10-04T15:20:49Z INFO ] 🚀 A new version of espflash is available: v3.1.1
[2024-10-04T15:20:49Z INFO ] Detected 3 serial ports
[2024-10-04T15:20:49Z INFO ] Ports which match a known common dev board are highlighted
[2024-10-04T15:20:49Z INFO ] Please select a port
[2024-10-04T15:20:49Z INFO ] Serial port: '/dev/ttyACM0'
[2024-10-04T15:20:49Z INFO ] Connecting...
r^C^C^C^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^\^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^Z^Z^Z^Z

@cacharle
Copy link
Author

This bug is the bane of my existence, any clue where I could start looking for it in the espflash codebase?

@SergioGasquez
Copy link
Member

I don't have many pointers, but here is where we wait for the Ctrl+C press: https://github.com/esp-rs/espflash/blob/main/espflash/src/cli/monitor/mod.rs#L118-L131. Might be related to the lib we use to process them (crossterm), we have an “outdated” version since new version were causing some issues on Windows, https://github.com/esp-rs/espflash/blob/main/espflash/Cargo.toml#L36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants