mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
Merge branch 'feature/idfpy_crtl_c_processing_4_win' into 'master'
tools: idf_exe: add Ctrl+C processing See merge request espressif/esp-idf!11357
This commit is contained in:
@@ -32,6 +32,17 @@ static void fail(LPCSTR message, ...)
|
|||||||
ExitProcess(1);
|
ExitProcess(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
|
||||||
|
{
|
||||||
|
switch (fdwCtrlType) {
|
||||||
|
// Handle the CTRL-C signal.
|
||||||
|
case CTRL_C_EVENT:
|
||||||
|
return TRUE;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, LPTSTR argv[])
|
int main(int argc, LPTSTR argv[])
|
||||||
{
|
{
|
||||||
/* Print the version of this wrapper tool, but only if invoked as "idf.exe".
|
/* Print the version of this wrapper tool, but only if invoked as "idf.exe".
|
||||||
@@ -79,6 +90,9 @@ int main(int argc, LPTSTR argv[])
|
|||||||
|
|
||||||
SetEnvironmentVariable(TEXT("IDF_PY_PROGRAM_NAME"), idfpy_script_name);
|
SetEnvironmentVariable(TEXT("IDF_PY_PROGRAM_NAME"), idfpy_script_name);
|
||||||
|
|
||||||
|
// Add processing for Ctrl+C
|
||||||
|
SetConsoleCtrlHandler(CtrlHandler, TRUE);
|
||||||
|
|
||||||
/* Reuse the standard streams of this process */
|
/* Reuse the standard streams of this process */
|
||||||
STARTUPINFO start_info = {
|
STARTUPINFO start_info = {
|
||||||
.cb = sizeof(STARTUPINFO),
|
.cb = sizeof(STARTUPINFO),
|
||||||
|
Reference in New Issue
Block a user