Microsoft Windows NT 10.0.18363.0
Windows Terminal (Preview) Version: 0.9.433.0
PowerShell Core 7.0.0
When running a long-running or infinite task from powershell, for example a watch-task for building and compiling, and I press "CTRL + C", the entire powershell process exits, and I have to create a new tab and navigate to the correct folder to be "where I was" before pressing "CTRL + C".
I would expect that "CTRL + C" would kill the long running process which was run from powershell, and not the entire powershell terminal tab. I would expect to return to powershell in the current working directory.
The entire tab stops and prints [process exited with code XXXXX]

(here I press CTRL + C right after [nodemon] clean exit - waiting for changes before restart)
How did you install powershell 7?
@DHowett-MSFT with scoop, https://scoop.sh, 芦scoop install pwsh禄 probably
This is very similar to https://github.com/PowerShell/PowerShell/issues/11314, but scoop needs to fix it on their end. Same exact problem. I can鈥檛 find the bug on their tracker right now, but somebody did file it. 馃槃
Thanks!
If other people are reading this, the solution is to change the exe being used, in windows terminal's profiles.json:
"commandline": "C:\\Users\\username\\scoop\\apps\\pwsh\\current\\pwsh.exe",
Thanks!
If other people are reading this, the solution is to change the exe being used, in windows terminal's
profiles.json:"commandline": "C:\\Users\\username\\scoop\\apps\\pwsh\\current\\pwsh.exe",
So, I've installed it as a global dotnet tool. How do I solve it? This is causing neural damage... I've become wary of using Ctrl+C. :confounded:
@jorgensigvardsson I haven't done that, but the problem for the scoop installation was that the pwsh.exe in PATH was a shimmed .exe, which did not work. If I changed to the real .exe, it worked. Maybe the global dotnet tool-installation also has another shim .exe? Check what you have in PATH when you run where.exe pwsh
Or locate the installation directory and see if there is another exe there
@oledid I only find pwsh.exe in my global dotnet directory C:\Users\user\.dotnet\tools. Maybe I should install it as a "real" application as well.
@jorgensigvardsson Yeah, maybe. Post it here if you find out :)
@oledid I downloaded the Power Shell 7 distribution for Windows x64, and Ctrl+C now works as expected. I hope my neurons will recover in time. 馃榾
And thank you very much for your help @oledid!
@jorgensigvardsson No prob, the problem made me pretty crazy too :)
FWIW this is the scoop issue: https://github.com/lukesampson/scoop/issues/3634 @DHowett-MSFT
Thank you @oledid . Just a small note: when configuring pwsh installed using Scoop in Windows Terminal replace line:
"source": "Windows.Terminal.PowershellCore",
with
"commandline": "%USERPROFILE%\\scoop\\apps\\pwsh\\current\\pwsh.exe",
if you are using default Scoop installation path.
To add icon:
"icon": "%USERPROFILE%\\scoop\\apps\\pwsh\\current\\assets\\StoreLogo.png",
Most helpful comment
Thanks!
If other people are reading this, the solution is to change the exe being used, in windows terminal's
profiles.json: