{"id":20409472,"url":"https://github.com/jsakamoto/ctrlcenabler","last_synced_at":"2025-04-12T15:51:01.037Z","repository":{"id":66230869,"uuid":"119058360","full_name":"jsakamoto/CtrlCEnabler","owner":"jsakamoto","description":"Ctrl+C Enabler for PowerShell","archived":false,"fork":false,"pushed_at":"2018-02-01T14:52:43.000Z","size":7,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T10:21:16.636Z","etag":null,"topics":["ctrl-c","powershell","sigbreak","sigint"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsakamoto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-26T14:05:04.000Z","updated_at":"2024-05-15T17:04:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"d34473f8-b127-4b5c-8510-776d9e1813f3","html_url":"https://github.com/jsakamoto/CtrlCEnabler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FCtrlCEnabler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FCtrlCEnabler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FCtrlCEnabler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FCtrlCEnabler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsakamoto","download_url":"https://codeload.github.com/jsakamoto/CtrlCEnabler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248591917,"owners_count":21130149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ctrl-c","powershell","sigbreak","sigint"],"created_at":"2024-11-15T05:42:01.639Z","updated_at":"2025-04-12T15:51:01.032Z","avatar_url":"https://github.com/jsakamoto.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ctrl+C Enabler for PowerShell\n\n## Summary\n\nThis is a .NET class library that allows you to enable Ctrl+C break on PowerShell console, always.\n\n## Why should be use this?\n\nIn some case, a PowerShell console, which is launched from Visual Studio IDE external tools menu, doesn't accept Ctrl+C.\n\nThis class library can fix it :)\n\n## How to install in your PowerShell?\n\n1. Download \"CtrlCEnabler.dll\" from [release page](../../releases), and save it into \"%HOME%\\Documents\\WindowsPowerShell\" folder.\n2. Open the PowerShell console and enter the following command:\n```powershell\nPS\u003e notepad $PROFILE\n```\n3. Then, the file \"Microsoft.PowerShell_profile.ps1\" is opened in a text editor.\n4. Append lines as follows at the bottom of \"Microsoft.PowerShell_profile.ps1\", and save it.\n```powershell\n# Enable Ctrl+C force.\nAdd-Type -Path \"$env:HOME\\Documents\\WindowsPowerShell\\CtrlCEnabler.dll\"\n[CtrlCEnabler]::EnableCtrlC() \u003e $null\n```\n\nAfter this instruction, the PowerShell console always enables Ctrl + C break, even when launched from Visual Studio's external tools menu.\n\n## How does it work?\n\nThis class library just calls the `SetConsoleCtrlHandler` Win32 API.\n\n```csharp\npublic static bool EnableCtrlC()\n{\n    return SetConsoleCtrlHandler(null, false);\n}\n```\n\nSee also:\n\n- https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals\n- https://docs.microsoft.com/en-us/windows/console/setconsolectrlhandler\n\n## LICENSE\n\n[The Unlicense](LICENSE)\n\n## Appendix\n\n\u003e In some case, a PowerShell console, which is launched from Visual Studio IDE external tools menu, doesn't accept Ctrl+C.\n\nA PowerShell console, which launced by [\"Open Command Line\"](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpenCommandLine) Visual Studio IDE Add-in, is alyways available Ctrl+C break.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2Fctrlcenabler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsakamoto%2Fctrlcenabler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2Fctrlcenabler/lists"}