8000 Completions for environment variables differ between platforms · Issue #3227 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Completions for environment variables differ between platforms #3227
@rjmholt

Description

@rjmholt

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                                                                                                                           

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0