Skip to content

Commit c048e12

Browse files
authored
Merge pull request #2991 from itowlson/fix-cant-stop-the-building
Fix spin watch Ctrl+C not working before first successful build
2 parents 29ba553 + 5e71f29 commit c048e12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/watch.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl WatchCommand {
115115
clear_screen: self.clear,
116116
has_ever_built: false,
117117
watched_changes: source_code_rx,
118-
uppificator_pauser: pause_tx,
118+
uppificator_pauser: pause_tx.clone(),
119119
};
120120

121121
let mut uppificator = Uppificator {
@@ -205,7 +205,9 @@ impl WatchCommand {
205205
// break out its run loop. This will cause the `uppificator_handle` future to
206206
// complete, which will cause the select to return.
207207
_ = ctrlc::set_handler(move || {
208-
_ = stop_tx.send(Uuid::new_v4());
208+
let _ = stop_tx.send(Uuid::new_v4());
209+
// Make sure the loop that processes the stop signal sees it
210+
let _ = futures::executor::block_on(pause_tx.send(Pause::Unpause));
209211
});
210212

211213
// As noted above, the most likely future to complete is the uppificator on a Ctrl+C.

0 commit comments

Comments
 (0)