static void Handle_Signal(int sig) { char *buf = strdup("[escape]"); Put_Str(buf); free(buf); RL_Escape(0); }
static void Handle_Signal(int sig) { REBYTE buf[] = "[escape]"; Put_Str(buf); RL_Escape(0); /* This will cause the next evalution escaped */ interrupted = 1; }
// // This is the callback passed to `SetConsoleCtrlHandler()`. The parallel // implementation in the POSIX code is `Handle_Signal()` // BOOL WINAPI Handle_Break(DWORD dwCtrlType) { switch(dwCtrlType) { case CTRL_C_EVENT: case CTRL_BREAK_EVENT: RL_Escape(0); return TRUE; // TRUE = "we handled it" case CTRL_CLOSE_EVENT: // // !!! Theoretically the close event could confirm that the user // wants to exit, if there is possible unsaved state. As a UI // premise this is probably less good than persisting the state // and bringing it back. // case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: // // They pushed the close button, did a shutdown, etc. Exit. // // !!! Review arbitrary "100" exit code here. // OS_Exit(100); return TRUE; // TRUE = "we handled it" default: return FALSE; // FALSE = "we didn't handle it" } }
static void Handle_Signal(int sig) { Put_Str("[escape]"); RL_Escape(0); }
static void Handle_Signal(int sig) { RL_Escape(0); /* This will cause the next evalution escaped */ interrupted = 1; }