Skip to content

Handle ~ in PATH #11531

@TylerLeonhardt

Description

@TylerLeonhardt

Steps to reproduce

  1. Put any executable (ex. myExe) at the following path: ~/foo/
  2. Add that path to your PATH
$env:PATH = "~/foo$([System.IO.Path]::PathSeparator)$env:PATH"

Try to tab complete your executable or just run myExe

Expected behavior

The executable myExe is run.

This works just fine in bash and zsh and things like .NET global tools rely on the ~ support in the PATH so we should really fix this.

caveat

Bash seems to do more - it can handle variables inside of the PATH but that seems like overkill and I can't think of any example that uses that "feature".

We handle tilda pretty much everywhere else, we should be able to support it in application resolution.

Actual behavior

The term 'myExe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-daily.20200108
PSEdition                      Core
GitCommitId                    7.0.0-daily.20200108
OS                             Darwin 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions