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

CurrentDirectoryPath doesn't get updated on directory change #9404

Closed
1 of 2 tasks
kauz56 opened this issue Dec 27, 2022 · 1 comment
Closed
1 of 2 tasks

CurrentDirectoryPath doesn't get updated on directory change #9404

kauz56 opened this issue Dec 27, 2022 · 1 comment
Labels

Comments

@kauz56
Copy link

kauz56 commented Dec 27, 2022

Version

Microsoft Windows [Version 10.0.22621.525]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.79.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

Query the CurrentDirectoryPath of a wsl.exe (or powershell.exe) process. I do this via NtQueryInformationProcess, which, I know, is an internal API. I'd assume the behaviour would be the same via injection + GetCurrentDirectory (not an internal API) though.

Expected Behavior

CurrentDirectoryPath should change according to the path I navigate to. This is the case with cmd.exe but not wsl.exe (or powershell.exe).

Actual Behavior

CurrentDirectoryPath stays at the starting directory.

I'll attach a video, demonstrating the behaviour:

2022-12-26_22-42-33.mp4

Diagnostic Logs

No response

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 27, 2022

Thanks for reporting this @kauz56.

What you're seeing is expected because wsl.exe's current directory is not correlated to the Linux's current directory inside WSL.
In other words, doing cd * inside wsl.exe doesn't change wsl.exe's current directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants