cmdlets hang ISE after CTRL+C

ismeisme Posts: 119
edited June 3, 2015 12:05PM in DLM Automation
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:
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

  • Hi Iain,

    I've just repeated this and appear to have reproduced it:
    PS C:UsersPeter.Gerrard> New-DatabaseConnection
    cmdlet New-DatabaseConnection at command pipeline position 1
    Supply values for the following parameters:
    ServerInstance: 
    PS C:UsersPeter.Gerrard> New-DatabaseConnection, SQL Release 1.2.0.2364, Copyright © Red Gate Software Ltd 2014-2015
    

    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.
    Peter Gerrard

    Software Engineer
    Redgate Software
  • PeterG wrote:
    pressing return gives me a fresh prompt or I can just type my command in again

    Thanks for checking that. I didn't think about pressing return!
    PeterG wrote:
    Could you try pressing return to see if this fixes it, please let me know either way.

    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.
    Iain Elder, Skyscanner
  • Just as an update, we have fixed this issue as of today's release (3rd June) in version 1.2.1.2643

    When you press Ctrl-C during parameter prompt you should no longer get any extra output and be on a fresh prompt.
    Peter Gerrard

    Software Engineer
    Redgate Software
Sign In or Register to comment.