Skip to content

Commit

Permalink
Message
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 21, 2024
1 parent ee05d15 commit 69aeedc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/signal.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "signal.hpp"

#include "cpp11/R.hpp"
#include "cpp11/function.hpp"
#include "cpp11/protect.hpp" // for safe
#include "duckdb/common/exception.hpp"

Expand Down Expand Up @@ -35,8 +36,12 @@ bool ScopedInterruptHandler::HandleInterrupt() const {
D_ASSERT(context);
}

// We're presumably still blocking interrupts here in the R session,
// so this is likely equivalent to cpp11::safe[Rf_onintrNoResume]()
// This seems necessary to work around a specificity with the RStudio IDE on Windows.
// Without the message, the interrupt is not available as a catchable condition.
// https://github.com/krlmlr/cancel.test/issues/1
cpp11::message("");

// FIXME: Is this equivalent to cpp11::safe[Rf_onintrNoResume](), or worse?
cpp11::safe[Rf_onintr]();
return true;
}
Expand Down

0 comments on commit 69aeedc

Please sign in to comment.