Skip to content

PowerShell beta hangs in Bash on Windows shell #3799

Closed

Description

Before the latest beta I was able to install and run the PowerShell 6 alphas in the Bash shell on Windows 10. Now, with the beta install, the shell hangs when I try to start PowerShell. I realize I could post an issue on GitHub but thought I'd check with the group first.

I am running Windows 10 build 16193.
In the Bash shell, which I just upgraded as well, I can see that PowerShell beta is installed.

powershell/xenial,now 6.0.0-beta.1-1ubuntu1.16.04.1 amd64 [installed]

lsb_release -a shows:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

I've even tried running powershell -noprofile with no change.

Ideas or suggestions for things to look at?

I see a similar comment at the end of #3747

Activity

  1. bgelens commented on May 17, 2017

    @bgelens
    Contributor

    The same happens with me.
    Looks similar to the issue with vs code PS ext. PowerShell/vscode-powershell#742

  2. jdhitsolutions commented on May 17, 2017

    @jdhitsolutions
    CollaboratorAuthor

    I wondered as well if the two issues aren't related.

  3. added
    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif
    on May 17, 2017
  4. jdhitsolutions commented on May 17, 2017

    @jdhitsolutions
    CollaboratorAuthor

    Because I had nothing left to try, I created profile scripts and put in the [System.Console]::OutputEncoding = [System.Text.Encoding]::ASCII line from the VSCode issue. Didn't make any difference.

  5. jdhitsolutions commented on May 17, 2017

    @jdhitsolutions
    CollaboratorAuthor

    This is interesting. I was able to get something like this to work in the Bash shell.

    powershell -nologo -OutputFormat Text -command "&{Get-Process}"
    
  6. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    I Already logged the incident in WSL GitHub awhile ago: PowerShell 6.0.0-beta hung up in Windows 10 Bash Console. microsoft/WSL#2124

    :)

  7. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    Jeff Hicks (@jdhitsolutions),

    Your line works! I tested the PowerShell Beta before installing .NET Code 2.0 Preview and it was working, meaning that I can get to the prompt. I was still having issues typing in the console with PowerShell Beta in the prompt.

    :)

  8. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    But, I can still use PowerShell in Windows 10 Bash in Ubuntu Desktop.

    poshbeta_bashgui_2017-05-17_10-28-40

  9. jdhitsolutions commented on May 17, 2017

    @jdhitsolutions
    CollaboratorAuthor

    I can see what I'm supposed to be running.

    jeff@YPJH10:/home$ powershell -nologo -command "&{Get-Variable PSVersionTable | Select -expand Value}"
    
    Name                           Value
    ----                           -----
    PSVersion                      6.0.0-beta
    PSEdition                      Core
    BuildVersion                   3.0.0.0
    CLRVersion
    GitCommitId                    v6.0.0-beta.1
    OS                             Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014
    Platform                       Unix
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  10. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    But!... You can't get to the prompt. Does by any chance, have you installed .NET Core in Bash?
    :)

  11. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    I got the notice on WSL "Microsoft .net Core team and powershell team have active bugs listed on this github repo."

    :)

  12. jdhitsolutions commented on May 17, 2017

    @jdhitsolutions
    CollaboratorAuthor

    Not sure what version of .NET core is running in my Bash shell. I'm going through the .NET Core 2.0 Preview 1 setup now.

  13. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    Jeff Hicks (@jdhitsolutions),

    I can tell you, installing .NET Core 2.0 Preview, that won't work. It was working before installing.

  14. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    I'm more tempted to do a clean Bash setup, then do a PowerShell Beta install to see if the .NET Core 2.0 Preview had something to do with PowerShell not opening.

    But, I will have to do this on my VM at home after work this evening.

  15. MaximoTrinidad commented on May 18, 2017

    @MaximoTrinidad

    FYI
    I completed testing PowerShell 6.0.0-beta on my Window 10 Bash Console. I uninstall and did a clean Bash installation without .NET Core 2.0 Preview 1 and PowerShell is getting hung.

    1. lxrun /uninstall /full
    2. lxrun /install
    3. Open Bash Console.
    4. sudo su ##-> Prepare for PowerShell Beta Install
      curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
      curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
      exit
    5. sudo apt update
    6. sudo apt upgrade ##-> This command will also install PowerShell
    7. Open PowerShell ##-> But it hungs, the prompt won't come up.

    powershellhungbash

  16. 6 remaining items

  17. MaximoTrinidad commented on May 19, 2017

    @MaximoTrinidad

    Well, at least I'm not on a total lost as I can use Ubuntu Desktop Terminal to run PowerShell without any issues. I know it will come around and be fixed later.

    Thanks again,
    :)

  18. jdhitsolutions commented on Jun 6, 2017

    @jdhitsolutions
    CollaboratorAuthor

    This still appears to be an issue with beta 2. I can run commands like this

    powershell -nologo -command "&{Get-process | sort-object WS -desc | select -first 5}"
    

    but no interactive session.

  19. added this to the milestone on Jun 6, 2017
  20. jdhitsolutions commented on Jun 7, 2017

    @jdhitsolutions
    CollaboratorAuthor

    Not sure if this will clarify things or make it more confusing. But on a clean Windows 10 build 14393 I installed WSL and then PowerShell beta 2. It works as expected. It does not work on Windows build 16199. At least for me.

  21. removed this from the milestone on Jun 7, 2017
  22. SteveL-MSFT commented on Jun 7, 2017

    @SteveL-MSFT
    Member

    Both the Windows console and WSL is changing, so it's going to be hard to determine what is actually causing the issue here. We should revisit this when the console and WSL stabilize.

  23. jdhitsolutions commented on Jun 7, 2017

    @jdhitsolutions
    CollaboratorAuthor

    I feel everything is a moving target these days. For what it's worth, on the older Win10 platforms WSL installs Ubuntu 14.04.05 LTS but in the latest builds it installs 16.04.2 LTS.

  24. jdhitsolutions commented on Jun 12, 2017

    @jdhitsolutions
    CollaboratorAuthor

    Here's an update: Just installed a new Windows 10 build (16215). Thought I'd try this again, and it worked! Now, I also updated Ubuntu before I tried and it looks like I got some libc stuff so I don't know what made a difference. But I will say, that PSReadline caused issues typing. Cursor would jump back and forth on the line, sometimes it seemed even prematurely inserting a return,and in general caused a distracting typing experience.

  25. SteveL-MSFT commented on Jun 12, 2017

    @SteveL-MSFT
    Member

    Jeff Hicks (@jdhitsolutions) the display problem is #1829

    Since you have this working and this issue isn't actionable by us, I'm closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifOS-WSLResolution-ExternalThe issue is caused by external component(s).WG-Interactive-Consolethe console experience

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions