Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Completions for environment variables differ between platforms #3227

Copy link
Copy link
@rjmholt

Description

@rjmholt
Issue body actions

When using both the console host and an editor like VSCode, completions are provided for
environment variables that differ across platforms. In the case of VSCode, I know it tries to
make recommendations for scripts that help them work cross-platform, and this seems to
fit in that category. Of course, plenty of environment variables are just not cross-platform, but
for things like $env:PSModulePath that come with PowerShell, it would make sense.

Given that Linux requires variable names that Windows tolerates but no vice-versa, perhaps we
should prefer those?

I wouldn't necessarily characterise this as a bug, but it might help obviate some bugs if changed. See #2937 and #2677. I know I have personally run into this when tests I wrote failed because I used
$env:PSModulePath, my reasoning being that the completion of a variable name would be the
canonical name for the variable.

Steps to reproduce

In a PowerShell terminal or editor with completions enter the input:

$env:PSM<Tab>

Expected behavior

The same completed variable name across platforms.

Actual behavior

On Windows:

$env:PSModulePath

On Linux:

$env:PSMODULEPATH

Environment data

> $PSVersionTable

Name                           Value                                                                                                 
----                           -----                                                                                                 
GitCommitId                    v6.0.0-alpha.16-28-g136213d6b4767370f0b6340ffbefa130fdc55327                                          
WSManStackVersion              3.0                                                                                                   
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                               
PSEdition                      Core                                                                                                  
BuildVersion                   3.0.0.0                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                   
SerializationVersion           1.1.0.1                                                                                               
PSVersion                      6.0.0-alpha                                                                                           
CLRVersion                                                                                                                           
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.