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

cd-ing to a new drive and back does not restore path #6749

Closed
rjmholt opened this issue Apr 26, 2018 · 6 comments · Fixed by #6774

Comments

@rjmholt
Copy link
Member

@rjmholt rjmholt commented Apr 26, 2018

Steps to reproduce

C:\Users\me\Documents> cd Z:
Z:\> cd C:

Expected behavior

Z:\> cd C:
C:\Users\me\Documents>

Actual behavior

Z:\> cd C:
C:\>

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.1
PSEdition                      Core
GitCommitId                    v6.1.0-preview.1-99-g35d8de927b8e408461a5b4fc40ba20016c68433e
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

It looks like #6600 caused a regression. It seems to be Windows only. I tested with a9781de with no repro and then with 35d8de9 to successfully repro.

Credit to @jianyunt.

@iSazonov

This comment has been minimized.

Copy link
Collaborator

@iSazonov iSazonov commented Apr 27, 2018

We need add new tests for this but I guess CI has only one filesystem drive.

@GeeLaw

This comment has been minimized.

Copy link

@GeeLaw GeeLaw commented Apr 27, 2018

@iSazonov We could use New-PSDrive -Name TestSetLocation -Provider FileSystem -Root Path\To\Root and later Remove-PSDrive -Name TestSetLocation later. Alternatively, we could use subst.exe for Windows.

@iSazonov

This comment has been minimized.

Copy link
Collaborator

@iSazonov iSazonov commented Apr 27, 2018

@GeeLaw Thanks! I guess we could use New-PSDrive -Name "Z" -Provider FileSystem -Root Path\To\Root - seems one char name can be important in the test.

@mcbobke

This comment has been minimized.

Copy link
Contributor

@mcbobke mcbobke commented Apr 27, 2018

Hoping to have some time this weekend to take a closer look at this regression. Thanks for filing the issue!

@mcbobke

This comment has been minimized.

Copy link
Contributor

@mcbobke mcbobke commented Apr 29, 2018

Dug into this tonight and I think this may be a move in the right direction. The expected behavior as noted by @rjmholt is produced.

@iSazonov

This comment has been minimized.

Copy link
Collaborator

@iSazonov iSazonov commented Apr 29, 2018

@mcbobke Feel free push PR - now we know what tests we need to add to exclude a regression.

rjmholt added a commit to rjmholt/PowerShell that referenced this issue Apr 30, 2018
…and $PWD is a sub folder of the drive root. (PowerShell#6600)"

This reverts commit 35d8de9.
See issue PowerShell#6749.
daxian-dbw added a commit that referenced this issue Apr 30, 2018
…or (#6751)

This reverts the commit 35d8de9, which caused a regression in drive behavior where drive paths were not restored. See issue #6749.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.