cmdlets hang ISE after CTRL+C
isme
Posts: 119
Hey RG,
In PowerShell ISE all the SQL Release cmdlets hang the PowerShell session if you press CTRL+C at the "supply values" prompt.
In PowerShell.exe, the same event cancels the cmdlet and returns control to the user.
Can you make the same thing work properly in ISE?
My SQL Release version is 1.2.0.2364.
Here's how to reproduce the problem in ISE for New-DatabaseConnection (the same steps work for any cmdlet):
1. Open PowerShell ISE (powershell_ise.exe).
2. At the prompt, type New-databaseConnection and press return.
3. Press CTRL+C to cancel the "supply values" prompt.
The prompt will hang with text like this:
You can work around the hung tab by opening a new PowerShell tab or by restarting ISE. Both workarounds are frustrating because you lose your session state.
Fixing this would make it easier to recover from mistakes when working interactively.
Cheers,
Iain
In PowerShell ISE all the SQL Release cmdlets hang the PowerShell session if you press CTRL+C at the "supply values" prompt.
In PowerShell.exe, the same event cancels the cmdlet and returns control to the user.
Can you make the same thing work properly in ISE?
My SQL Release version is 1.2.0.2364.
Here's how to reproduce the problem in ISE for New-DatabaseConnection (the same steps work for any cmdlet):
1. Open PowerShell ISE (powershell_ise.exe).
2. At the prompt, type New-databaseConnection and press return.
3. Press CTRL+C to cancel the "supply values" prompt.
The prompt will hang with text like this:
PS C:UsersRedGate> New-DatabaseConnection cmdlet New-DatabaseConnection at command pipeline position 1 Supply values for the following parameters: ServerInstance: PS C:UsersRedGate> New-DatabaseConnection, SQL Release 1.2.0.2364, Copyright © Red Gate Software Ltd 2014-2015
You can work around the hung tab by opening a new PowerShell tab or by restarting ISE. Both workarounds are frustrating because you lose your session state.
Fixing this would make it easier to recover from mistakes when working interactively.
Cheers,
Iain
Iain Elder, Skyscanner
Comments
I've just repeated this and appear to have reproduced it:
Though it does not appear to hang for me, pressing return gives me a fresh prompt or I can just type my command in again. Which suggests to me it is a visual bug, which I will raise with the rest of the team. Could you try pressing return to see if this fixes it, please let me know either way.
Software Engineer
Redgate Software
Thanks for checking that. I didn't think about pressing return!
I no longer have access to the RedGate demo VM I was testing on.
If I can set up my own test environment I will try your workaround and let you know.
When you press Ctrl-C during parameter prompt you should no longer get any extra output and be on a fresh prompt.
Software Engineer
Redgate Software