Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Print dedicated message on control + c #248

Merged
merged 7 commits into from
Sep 8, 2021
Merged

Print dedicated message on control + c #248

merged 7 commits into from
Sep 8, 2021

Conversation

Lotterleben
Copy link

Resolves #231 , but in a slightly awkward way– imo halted_due_to_signal should be merged into Outcome but that's a bigger rabbithole and I wanted to open this PR first to get some general feedback and then tackle that in either this or a follow-up PR.

This PR also adds a test for this new functionality.
I've slightly refactored our test helpers to accommodate the need for a "run and terminate" option. To ensure that tests still run sequentially, I'be switched them to serial_test.

While I was at it, I also fixed 2 typos I came across.

@Lotterleben Lotterleben changed the title WIP Print dedicated message con control + c Print dedicated message on control + c Aug 16, 2021
@Lotterleben
Copy link
Author

@ test failure: welp.. yeah. I could've thought of that. -.-

@Lotterleben Lotterleben marked this pull request as draft August 16, 2021 17:05
}
}

#[cfg(target_family = "unix")]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from what I understand so far, simulating a ctrl+c on windows is a bit finicky (you'd probably use the winapi crate which is a bit underdocumented?) and I don't have a windows machine at hand to play with this so I opted for this makeshift solution

@Lotterleben Lotterleben marked this pull request as ready for review September 7, 2021 14:18
@jonas-schievink
Copy link
Contributor

Nice work!

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 8, 2021

Build succeeded:

@bors bors bot merged commit 0f356d6 into main Sep 8, 2021
@bors bors bot deleted the 231-ctrl-c-msg branch September 8, 2021 14:57
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"device halted without error" shouldn't be printed when using Ctrl+C
2 participants