Skip to content

Commit

Permalink
Fix spin watch Ctrl+C not working before first successful build
Browse files Browse the repository at this point in the history
Signed-off-by: itowlson <[email protected]>
  • Loading branch information
itowlson committed Jan 26, 2025
1 parent 29ba553 commit 5e71f29
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 5e71f29

Please sign in to comment.