Skip to content

Commit

Permalink
Merge pull request #2991 from itowlson/fix-cant-stop-the-building
Browse files Browse the repository at this point in the history
Fix spin watch Ctrl+C not working before first successful build
  • Loading branch information
itowlson authored Jan 27, 2025
2 parents 29ba553 + 5e71f29 commit c048e12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl WatchCommand {
clear_screen: self.clear,
has_ever_built: false,
watched_changes: source_code_rx,
uppificator_pauser: pause_tx,
uppificator_pauser: pause_tx.clone(),
};

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

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

0 comments on commit c048e12

Please sign in to comment.