Closed MaximoTrinidad closed 6 years ago
Hooold on, you're doing something that you're not telling us.
You can't launch powershell like that unless you either aliased it or added something to your PATH
, but more likely aliased (since you're starting without the ".exe").
Let's begin at the beginning.
@fpqc He's running the Linux version of powershell.
Yes @benhillis! You are correct. I'm running Linux version of PowerShell (no exe included). And, this was opening fine when using Bash (Ubuntu 14.04). :)
@MaximoTrinidad sudo chown -R maxt ~/.local
@ddfznt Ouch!! This will work around the issue and I don't know how much is will impact using PowerShell. But, very interesting!
Thanks, Max
@MaximoTrinidad https://github.com/Microsoft/vscode/issues/6684 take a look here!
Hi @ddfznt! Thanks but that issue is not related. That's on using VS Code Windows OS not BASH. I have not problems with VS Code running PowerShell Core on either Windows 10 nor Linux. It's just with the recent BASH update. :)
sample "Terminal working fine".
Am I to understand you're attempting to spawn a Powershell instance while under the WSL bash.exe instance? I'm curious what the use case is for this and if you're able to run a cmd.exe which then spawns Powershell.
I didn't think Windows PE binaries were launchable from within WSL. Is this new or was I just blind?
@afinnel it was announced to much fanfare like 2 weeks ago.
This is the thing!
Yes, you can launch Window binaries from WSL. But, this is what I found out today.
For example, you are creating a cross-platform PowerShell script and launch Windows VS Code (from Bash) to create the file in the Linux subsystem, it won't be visible in Bash. It will be visible in Windows Explorer and Windows VS Code.
Try to use the Nautilus to look for the file created in Windows VS Code, and you won't find it. So, for me, I can't use the Windows Version of VS Code to create PowerShell scripts in Bash Linux subsystem.
Also, if I create a PowerShell script file using 'gedit' and then use Windows VS Code to change it., then I won't see the file in Bash again.
Now, back to the topic. Beside the known display issue with PowerShell, I could open it without using 'sudo' before Bash got upgraded to Ubuntu 16.04.1.
I'm suspecting something with the user profile permission.
:)
It will work as long as it's on a volume mounted in /mnt
@fpqc
No! I want to have a workable PowerShell Core (Linux) on Bash so I can test cross-platform PS scripts.
Anyway, I just tested executing the Windows PowerShell in Bash using: "/mnt/c/Program Files/PowerShell/6.0.0.12/powershell.exe"
It doesn't work. I won't use it that way but it was good to try it.
:)
Can you clarify what you mean by doesn't work?
Hi @benhillis,
After you enter "/mnt/c/Program Files/PowerShell/6.0.0.12/powershell.exe", the PowerShell prompts comes up OK.
At this point I rather not use Windows PowerShell.exe in Bash.
But, I definitely have more control in PowerShell Core (Linux) when using 'xterm' in Bash using sudo.
Of course, I'm using Xming, and configure xterm to allow scrolling.
@MaximoTrinidad Thanks for the feedback. The limitations you mention in 1, 2, 4, and 5 are due to the way console handles are currently managed. I have a thread with @bitcrazed @zadjii-msft and @miniksa to see the best way to resolve those issues.
Issue 3 is more related to the difference between the way Linux and Windows processes handle control c. I have a task on my backlog to look into this.
This is Awesome! Thanks. I started to show the work around and record my UG meeting on using Bash and PowerShell Core (Linux). I know there are limitations but at least (for me) using xterm is a winner to some UX win. I like the cross-platform collaboration.
Again, a clean Bash installation, follow by loading PowerShell Core, there's a message coming up when executing 'powershell' (w/o sudo). I couldn't print the screen but it seem couldn't load some modules and it looks related to user profile issue. I will rebuild my bash on my other machine to trap the error.
I like the direction this is heading! :)
@maximotrinidad, you should use wsltty , which uses mintty instead of xterm
@fpqc That's just a work around. We should also fix our stuff if possible!
@bitcrazed Of course, but it is preferable to xterm over X over TCP. It can at least use local fonts. Also, I was trying to figure out the markdown syntax for linking another repo, it is:
[linktext](/username/repo)
You can also manipulate the path like any old path, so you could do:
which in markdown looks like
[vscode issues](../../vscode/issues)
No more c&p URLs on a phone for me!
Thanks @fpqc for recommending wsltty. I will check it out! :)
Closing this out as the issues with interop console handles is being tracked elsewhere.
Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!
sudo powershell
This was working fine with Ubuntu 14.04. The workaround still works except now I have to use 'sudo powershell'.
(http://www.maxtblog.com/2016/10/running-powershell-in-windows-10-bash-workaround/ )
Expected results to give me the PowerShell prompt.
Actual results (with terminal output if applicable) maxt@MTrinidadLT2:~$ powershell PowerShell Copyright (C) 2016 Microsoft Corporation. All rights reserved.
The shell cannot be started. A failure occurred during initialization: Access to the path '/home/maxt/.local/share/powershell/Modules' is denied. maxt@MTrinidadLT2:~$
Your Windows build number Windows 10 Pro Insider Preview Build 14951
Steps / All commands required to reproduce the error from a brand new installation
Strace of the failing command non
Required packages and commands to install Follow instructions at: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#ubuntu-1604
See our contributing instructions for assistance.