Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to Powershell breaks workflow for Elixir #21753

Closed
ghost opened this issue Mar 2, 2017 · 8 comments
Closed

Change to Powershell breaks workflow for Elixir #21753

ghost opened this issue Mar 2, 2017 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 2, 2017

VSCode Versions 1.9 - 2.0
Windows 10

Steps to Reproduce:

  1. Install Elixir following the [official docs}(http://elixir-lang.org/install.html)
  2. Install VSCode version < 1.9
  3. Press ctrl + ` to open VSCode's command line
  4. Elixir REPL can be started with iex and mix tasks work as expected.
  5. Upgrade VSCode and reopen it
  6. Press ctrl + ` to open VSCode's command line
  7. Both iex and mix now fail.
@isidorn
Copy link
Contributor

isidorn commented Mar 2, 2017

Please file this to the vscode powershell extension here https://github.com/PowerShell/vscode-powershell

@joaomoreno
Copy link
Member

This started happening since #16838 @Tyriar

@toshuo Just to confirm, make sure your scenario still works if you set the following setting:

  "terminal.integrated.shell.windows": "cmd.exe"

If it does work, we need to figure out why those PATH binaries are not present in your PowerShell environment. In PowerShell, inside Code, what do you get with echo $env:PATH?

@ghost
Copy link
Author

ghost commented Mar 2, 2017

How do I enter that setting? Here is some more debugging info:

PowerShell path:

> echo $env:PATH
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\P
rogram Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\小馬\.dnx\bin;C:\Program Files\Microsoft DNX
\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Wind
ows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\erl7.2.1\bin;C:\Program Files\Postgre
SQL\9.5\bin;C:\Program Files\nodejs\;C:\Users\小馬\AppData\Local\Code\bin;C;C:\WINDOWS\system32;C:\WINDO
WS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\prog\util;C:\Program Files (x
86)\Skype\Phone\;C:\Program Files (x86)\Elixir\bin;C:\Users\小馬\.mix\escripts;C:\Program Files (x86)\El
m Platform\0.18\bin;D:\prog\Ruby23\bin;C:\Users\小馬\AppData\Roaming\npm;C:\Program Files (x86)\Microsof
t VS Code\bin

Trying to run mix:

> mix
mix : C:\Program因為這個系統上已停用指令碼執行,所以無法載入 C:\Program Files (x86)\Elixir\bin\mix.ps1 檔案。如需
詳http://go.microsoft.com/fwlink/?LinkID=135170細資訊,請參閱 about_Execution_Policies,網址為 http://go.microsoft.com/fwlink/?LinkID=135170。
位於 線路:1 字元:1
+ mix
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Trying to start phoenix server with iex

> iex -S mix phoenix.server
Invoke-Expression : 找不到符合參數名稱 'S' 的參數。
位於 線路:1 字元:5
+ iex -S mix phoenix.server
+     ~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-Expression],ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeExpressionCom
   mand

@joaomoreno
Copy link
Member

Have you found this?

http://stackoverflow.com/questions/40011452/cannot-run-elixir-application-from-powershell

You can change the setting by opening the settings:

image

@ghost
Copy link
Author

ghost commented Mar 2, 2017

I had seen that SO piece, but couldn't find a way to disable the powershell iex alias. Since I type that about as often as cd while doing elixir, it's really not ideal to have to add four more keystrokes every time.

I also spent a good deal of time trying to fix the problem with mix. I know it's related to security policies, but my attempts to change them were denied.

@ghost
Copy link
Author

ghost commented Mar 2, 2017

Re changing the default shell: I had tried that and it hadn't worked but I now see that it just required a restart after editing the settings.json.

This is still a major issue, given that the default behavior of VSCode is now broken for one of the most compelling tech stacks.

@joaomoreno
Copy link
Member

it just required a restart after editing the settings.json

cc @Tyriar

@Tyriar Tyriar removed the *caused-by-extension Issue identified to be caused by an extension label Mar 2, 2017
@rkeithhill
Copy link

rkeithhill commented Mar 2, 2017

@toshuo Removing this alias from PowerShell is easy: Remove-Item Alias:\iex -Force.

Now you don't want to run that command every time, so add that command to your PowerShell profile script at ~\Documents\WindowsPowerShell\profile.ps (create the dir/file if it doesn't exist). After that, whenever you open PowerShell, the iex alias will not be defined.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants