vscode-neovim: Working directory not set correctly with WSL installation

Right now, :pwd gives me /mnt/c/<user>/AppData/Local/Programs/Microsoft VSCode in every document and workspace. I think the working directory should actually be the current workspace, to match the behavior of VSCode’s integrated terminal.

I’m using a Neovim installation on WSL. The working directory is the same regardless of whether I open a file in WSL or Windows.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

To revert:

image

Possibly related, I get this error in VSCode Neovim output on launch:

E344: Can't find directory "home<user><workingdirectory>" in cdpath
E484: Can't open file $MYVIMRC

E344 has been anonymized, basically it’s the working directory with no slashes.

Error should be fixed in latest version.

However, the original issue (pwd not set in WSL) remains.

Hi, after upgraded from version 0.0.84 to 0.0.85, that always prompt the message below when VSCode start:

Error detected while processing command line:
E344: Can't find directory "home<my-user-name><my-vscode-project-path>" in cdpath
E472: Command failed

My VSCode infomation:

Version: 1.67.2 (user setup) Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 Date: 2022-05-17T18:15:52.058Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.22000

Neovim-0.6.1@Ubuntu-20.04@WSL2

I’m also experiencing this error…does this error directly affect usability at all?

I still have it and until today is just a minor nuisance on startup, don’t think i’ve run into any problem because of this. It would be nice if we could get rid of the error but I think we can safely ignore it.

Yeah got the same issue as @jackblackevo. How do I downgrade this extension to the previous version (0.0.84) in the meantime?

Uninstall -> install other version.

I might be wrong in assuming this is the same issue but this appears to also happen in any remote connection in vscode. I have the same problem on linux when I use VSCode’s remote extension to ssh into another machine. !pwd returns the local path with the local user instead of using the remote user and directory of the workspace that VSCode is using. This also affects any file open or edit commands. It displays the working directory of the local user and path.

“missing slash ( or backslash) in the (linux/windows style) path”, +1 windows: image (the last line is the result of pwd)

remote linux:
image

“I don’t see any noticeable negative effects from the error”, +1

While using an empty init.vim, same error still exists