-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
terminal.integrated.shell does not support parameters #7266
Comments
Also hit this on OS X. Was able to work around it by creating a shell script that then invokes the shell with the desired parameters. Try creating a Would be nice if we had |
@coreh nice workaround :) |
what i don't understand is where is VS Code pulling the execution policy from? if i run powershell.exe -noprofile or ise -noprofile they both show get-executionpolicy as remotesigned. But with powershell set as the default integrated shell based on @be5invis settings (without the executionpolicy switch) it shows as restricted. |
@jbruettcva I'm just taking a guess here but I think the issue is VSCode is somehow opening a PowerShell instance with all execution policy scopes set to "Undefined". If you run the following command within the integrated shell you will see all scopes set to this: Get-ExecutionPolicy -Scope CurrentUser
Get-ExecutionPolicy -Scope LocalMachine
Get-ExecutionPolicy -Scope Process
# These below are for GPO enforced execution policies
Get-ExecutionPolicy -Scope UserPolicy
Get-ExecutionPolicy -Scope MachinePolicy I could be wrong but I am guessing that when all 5 scopes are set to "Undefined" then Windows will by default use a "Restricted" policy to play it safe. If you set any one of those scopes to something other than "Undefined" you will see Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned Aside from the "Process" scope, all execution policies are stored in the registry. So I can only imagine there might be an issue trying to access those registry keys at the time PowerShell is being launch from VSCode. Generally, when most people setup their execution policy initially, they don't specify a scope, which means by default they are setting the "LocalMachine" scope, which should be readable by all. EDIT Looking into this further I found that the instance of PowerShell that is getting loaded in the integrated shell is in fact an x86 version of PowerShell. Which is odd since the path to the PowerShell executable we are providing is for the x64 version. My guess is Windows sees that VSCode is an x86 app and automatically runs the x86 PowerShell version. If you run the following you can see for yourself: $env:PROCESSOR_ARCHITECTURE Further more if you go to the following location, run the x86 instance of PowerShell and then run the 5 Get commands I listed above you will see the same settings you see inside the integrated shell. So this looks more to be an issue with loading the wrong architecture of PowerShell.
This of course means that you can go into the x86 version of PowerShell, set your execution policy as you like and then that setting will be present when loading the integrated shell. |
@The-New-Guy yes just using "poweshell.exe" will use the 32 bit version. If you have any ideas how to communicate/guide users to use the 64 bit version join in at #7095 |
#7341 bat file is working now @Tyriar thanks https://github.com/chintan3/vscodetest/blob/master/README.md |
Just added the config keys {
"terminal.integrated.shell.linux": "bash",
"terminal.integrated.shellArgs.linux": [ "-l" ]
} |
The {
// The path of the shell that the terminal uses on Windows.
"terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k echo foo"
]
} |
@erichiller yes, it was added and then removed when we tested and realized it didn't work. This is due to an upstream issue. It's being tracked in #8429 |
With 1.7.1 out, I haven't been able to get this working. Was it possibly delayed? |
@erichiller it should work fine, are you getting some error message? |
Works for me with version 1.7.2! I'm using powershell and able to set execution policy and add the node_modules/.bin to the path. "terminal.integrated.shell.windows": "C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe", |
@delence ... U can help me? I Need set this args: How to set Correctly? |
I got it!
|
With VS Code 1.15.1 x64 on Windows 7 and PowerShell 5.1
This doesn't load my themed prompt. It prints out the Invoke-Expression line instead of running it.
I changed the
|
@Tyriar .. Would you please explain what does running "bash -l" buy us on osx (why run .bash_profile?) |
Edit: @kim0's question was about running |
@Tyriar @coreh .. Thanks, I would like to argue that always launching a bash login shell is incorrect. Bash offers two initialization schemes
I would argue that we should not be launching Ofcourse I'm happy to be wrong about all of this, corrections welcome. But just launching Thanks! |
@kim0 you're preaching to the choir, if you dig through issues you will see me arguing exactly this and I think quoting that exact link. However, macOS is different in that |
@kim0 Oh, sorry, I understood your question as being about the general purpose of |
set
does not work. If I remove the parameters Powershell refuses to run script, even $PROFILE.
The text was updated successfully, but these errors were encountered: