Title: pwsh as a dotnet global tool exhibits very unusual behavior with Ctrl-C · Issue #11314 · PowerShell/PowerShell · GitHub
Open Graph Title: pwsh as a dotnet global tool exhibits very unusual behavior with Ctrl-C · Issue #11314 · PowerShell/PowerShell
X Title: pwsh as a dotnet global tool exhibits very unusual behavior with Ctrl-C · Issue #11314 · PowerShell/PowerShell
Description: Steps to reproduce Install powershell as a dotnet global tool. Run a long-running thing (like Start-Sleep), and then press Ctrl+C Expected behavior I am returned to a powershell prompt. C:\Users\duhowett>.\.dotnet\tools\pwsh PowerShell 6...
Open Graph Description: Steps to reproduce Install powershell as a dotnet global tool. Run a long-running thing (like Start-Sleep), and then press Ctrl+C Expected behavior I am returned to a powershell prompt. C:\Users\du...
X Description: Steps to reproduce Install powershell as a dotnet global tool. Run a long-running thing (like Start-Sleep), and then press Ctrl+C Expected behavior I am returned to a powershell prompt. C:\Users\du...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11314
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pwsh as a dotnet global tool exhibits very unusual behavior with Ctrl-C","articleBody":"# Steps to reproduce\r\n\r\nInstall powershell as a dotnet global tool. Run a long-running thing (like Start-Sleep), and then press \u003ckbd>Ctrl+C\u003c/kbd>\r\n\r\n# Expected behavior\r\n\r\nI am returned to a powershell prompt.\r\n\r\n```none\r\nC:\\Users\\duhowett>.\\.dotnet\\tools\\pwsh\r\nPowerShell 6.2.3\r\n\r\n(dhowett-dev2) ~ % start-sleep 10\r\n^C\r\n(dhowett-dev2) ~ % # i am returned to a powershell prompt\r\n```\r\n\r\n# Actual behavior\r\n\r\nThe [dotnet tool shim](https://github.com/adityapatwardhan/PowerShell/blob/master/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs) hosting powershell terminates and returns control to _cmd_, but powershell remains connected to the console and reads input simultaneously. PowerShell and CMD share the input buffer, and neither of them can agree on what goes into it.\r\nIf you manage to exit cmd, powershell re-asserts control.\r\n\r\nThe `dir` in the snippet below came from _cmd_\r\n\r\n```none\r\nC:\\Users\\duhowett>.\\.dotnet\\tools\\pwsh\r\nPowerShell 6.2.3\r\n\r\n(dhowett-dev2) ~ % start-sleep 10\r\n^C\r\nC:\\Users\\duhowett>\r\n(dhowett-dev2) ~ % dir\r\n Volume in drive C is Cesium\r\n Volume Serial Number is E499-450A\r\n\r\n Directory of C:\\Users\\duhowett\r\n```\r\n\r\n\r\n\r\nThe blue `d` came from powershell, and the `ir` came from cmd.\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.3\r\nPSEdition Core\r\nGitCommitId 6.2.3\r\nOS Microsoft Windows 10.0.19041\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/DHowett-MSFT","@type":"Person","name":"DHowett-MSFT"},"datePublished":"2019-12-10T21:10:57Z","url":"https://github.com/PowerShell/PowerShell/issues/11314"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3dd719f9-5ffd-4555-8921-5dabcee5250d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C382:BB03C:185D0F:226C78:6AFD501E |
| html-safe-nonce | 4985917ab7cdaaba9dd3de9cc5617a131f89ae639157cfbe7e1732da865f7397 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzgyOkJCMDNDOjE4NUQwRjoyMjZDNzg6NkFGRDUwMUUiLCJ2aXNpdG9yX2lkIjoiMTIzODcxMjMyNzA4ODE5NzY2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d810eca5631442b4edf67624ebb79b373cb0ae390807ae06f4b213476b204288 |
| hovercard-subject-tag | issue:535996017 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/11314/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00a8e95a388420dc2a36e4887e0599d0a114a82aec500c719d5471be214cd603/PowerShell/PowerShell/issues/11314 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00a8e95a388420dc2a36e4887e0599d0a114a82aec500c719d5471be214cd603/PowerShell/PowerShell/issues/11314 |
| og:image:alt | Steps to reproduce Install powershell as a dotnet global tool. Run a long-running thing (like Start-Sleep), and then press Ctrl+C Expected behavior I am returned to a powershell prompt. C:\Users\du... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DHowett-MSFT |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width