Can I send a ctrl-C (SIGINT) to an application on Windows?

前端 未结 17 2621
甜味超标
甜味超标 2020-11-22 09:15

I have (in the past) written cross-platform (Windows/Unix) applications which, when started from the command line, handled a user-typed Ctrl-C combinat

17条回答
  •  不要未来只要你来
    2020-11-22 09:53

    SIGINT can be send to program using windows-kill, by syntax windows-kill -SIGINT PID, where PID can be obtained by Microsoft's pslist.

    Regarding catching SIGINTs, if your program is in Python then you can implement SIGINT processing/catching like in this solution.

提交回复
热议问题