From cb41562e334c4f96ff1cc02d865370ac2acf8ccc Mon Sep 17 00:00:00 2001 From: Geoffroy Lesur Date: Tue, 7 Jul 2026 15:11:06 +0200 Subject: [PATCH] restore ctrl-c in pydefix --- src/pydefix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pydefix.cpp b/src/pydefix.cpp index 1b816808..f7044af7 100644 --- a/src/pydefix.cpp +++ b/src/pydefix.cpp @@ -13,6 +13,7 @@ #include // For STL vectors and containers #include #include +#include #include "idefix.hpp" #include "dataBlock.hpp" #include "dataBlockHost.hpp" @@ -278,6 +279,7 @@ Pydefix::Pydefix(Input &input) { idfx::cout << "Pydefix: start Python interpreter." << std::endl; py::initialize_interpreter(); + std::signal(SIGINT, SIG_DFL); // restore "terminate on Ctrl-C" signal handler py::exec("import sys; print(f'Pydefix: Python Version: {sys.version}')"); py::exec("print(f'Pydefix: Executable Path: {sys.executable}')"); py::exec("print(f'Pydefix: Sys Path: {sys.path}')");