Menu

Ctrl+c does not work on both msys2 terminal and Windows cmd

Help
hongxu
2022-11-04
2022-12-03
  • hongxu

    hongxu - 2022-11-04

    Hi all,
    Below simple program can't be terminated by Ctrl+c with both msys2 terminal and Windows cmd.
    Note: "sleep 60" on msys2 terminal can be stopped by "ctrl+c".
    Any idea about this?

    #include <windows.h>
    int main()
    {
        ::Sleep(5 * 1000);
        return 0;
    }
    

    binary type: PE32+ executable (console) x86-64, for MS Windows
    linked library:
    ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ff9a1710000)
    KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ff9a08a0000)
    KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ff99ef30000)
    msys-2.0.dll => /c/Windows/SYSTEM32/msys-2.0.dll (0x180040000)

     

    Last edit: hongxu 2022-11-04
    • Sam Tansy

      Sam Tansy - 2022-12-03

      Tried that with mingw-gcc-8.1 (official), and winlibs-gcc-12.2 on x86 through wine and ^C works.

       
  • Braxton

    Braxton - 2022-12-03

    Yeah you are right. According to my experience from the previous session where I applied it on psl draft so that we could control our automation. Your script is fine and it will work properly. But may be the system with which you are using it could be something different from the configuration.

     

Log in to post a comment.