speeddownloadwide.blogg.se

Ctrl c doesn t work
Ctrl c doesn t work










Instead of hitting the KeyboardInterrupt catch statement, the script aborts abruptly, spitting out the following message:įorrtl: error (200): program aborting due to control-C event Under my ArcGIS 9.3.1 SP2/Windows XP SP3 environment, there is an issue with catching the KeyboardInterrupt exception if the arcgisscripting module is loaded.

ctrl c doesn t work

We can reset the behavior of Ctrl + C to system default with following code.The KeyboardInterrupt exception - thrown when Ctrl-C, or Ctrl-Break on some machines, are pressed in a Python console window - is commonly used to gracefully break out of long-process loops, allowing your script to perform cleanup, logging etc, before exiting. I think, therefor, the PowerShell console that is a child process of Visual Studio IDE is also ignoring the Ctrl + C.Īfter thinking for a while, I tried to solve this issue by calling SetConsoleCtrlHandler Win32 API in the PowerShell console in-process. I guess, Visual Studio IDE (or any extensions live in it) calls SetConsoleCtrlHandler Win32 API to ignore to default behavior of Ctrl + C key pressing. This Win32 API allows a Win32 process to customize the behavior of Ctrl + C key is pressed.Īnd, this is an important point, the document says the effect of changing this behavior inherits to the child process! Only the PowerShell which is a child process of Visual Studio IDE has the problem.Īfter for a long hour my investigation with internet searching, I found SetConsoleCtrlHandler Win32 API. Pressing Ctrl + C keys can terminate a command when it is running.

ctrl c doesn t work

In the PowerShell console which is opened NOT from Visual Studio IDE, such as from start menu or from Windows Explorer menu or from "Run" box or etc., Ctrl + C is working very fine expectedly.

ctrl c doesn t work

  • After that, when I want to stop the running console app (in this case, "cordova" command), I press Ctrl + C usually.
  • And I execute some long running console app, like "cordova run browser".
  • I open the PowerShell console with Ctrl+P, Ctrl+S key combination from Visual Studio IDE.
  • I found that Ctrl + C is always ignored in the PowerShell console, which launched from Visual Studio IDE external tools menu.įor example, one of the scenario is this: So I can open a PowerShell console rapidly, just entering two stroke keys, and the working directory is present in solution folder.

    ctrl c doesn t work

    Recently, I registered the command for launching PowerShell console at > menu in Visual Studio IDE, with the keyboard shortcut: Ctrl+P, Ctrl+S. I'm a developer who usually uses Visual Studio IDE on Windows OS.












    Ctrl c doesn t work