File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -555,8 +555,16 @@ namespace
555555 if (opt.singleCpp )
556556 {
557557 int rc = vix::commands::RunCommand::detail::run_single_cpp (opt);
558+
559+ if (rc == 130 )
560+ {
561+ hint (" ℹ Program interrupted by user (SIGINT)." );
562+ return 0 ;
563+ }
564+
558565 if (rc < 0 )
559566 return -rc;
567+
560568 return rc;
561569 }
562570
Original file line number Diff line number Diff line change 2727#include < string>
2828#include < system_error>
2929
30+ #ifndef _WIN32
31+ #include < signal.h>
32+ #endif
33+
3034namespace vix ::commands::RunCommand::detail
3135{
3236 namespace process = vix::cli::commands::helpers;
@@ -63,6 +67,19 @@ namespace vix::commands::RunCommand::detail
6367#endif
6468 }
6569
70+ #ifndef _WIN32
71+ bool is_user_interrupt_result (const LiveRunResult &result) noexcept
72+ {
73+ return result.exitCode == 130 ||
74+ (result.terminatedBySignal && result.termSignal == SIGINT);
75+ }
76+ #else
77+ bool is_user_interrupt_result (const LiveRunResult &result) noexcept
78+ {
79+ return result.exitCode == 130 ;
80+ }
81+ #endif
82+
6683 /* *
6784 * @brief Return a filesystem-safe executable name.
6885 */
@@ -516,6 +533,12 @@ namespace vix::commands::RunCommand::detail
516533 opt.enableSanitizers || opt.enableUbsanOnly ,
517534 false );
518535
536+ if (is_user_interrupt_result (run))
537+ {
538+ hint (" ℹ Program interrupted by user (SIGINT)." );
539+ return 0 ;
540+ }
541+
519542 handle_runtime_exit_code (run.exitCode , " run" , run.failureHandled );
520543 return run.exitCode ;
521544 }
You can’t perform that action at this time.
0 commit comments