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

VS Code fails to start if current directory no longer exists #10689

Closed
rmunn opened this issue Aug 19, 2016 · 2 comments
Closed

VS Code fails to start if current directory no longer exists #10689

rmunn opened this issue Aug 19, 2016 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@rmunn
Copy link
Contributor

rmunn commented Aug 19, 2016

  • VSCode Version: Version 1.4.0 (commit 6276dcb)
  • OS Version: Ubuntu Linux 14.04

Steps to Reproduce:

  1. On Linux (or possibly on OS X), open two separate terminal windows.
  2. In both windows, run cd with no arguments so you're in your home directory.
  3. In the first terminal, run:
    • mkdir foo
    • cd foo
    • echo "Hello" > file.txt
  4. In the second terminal, run:
    • mkdir bar
    • cd bar
    • code ~/foo/file.txt
  5. VS Code starts up fine, and loads ~/foo/file.txt without problems.
  6. Exit VS Code.
  7. In the first terminal, run rmdir ~/bar. This will succeed on Linux, because processes don't lock their current working directory while running. So having a terminal window open, cd'ed into ~/bar, does not lock ~/bar and it can therefore be removed by other terminals.
  8. Now in the second terminal, run code ~/foo/file.txt again. VS Code will fail with the following error:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
sh: 0: getcwd() failed: No such file or directory
path.js:1184
          cwd = process.cwd();
                        ^

Error: ENOENT: no such file or directory, uv_cwd
    at Error (native)
    at Object.resolve (path.js:1184:25)
    at Function.Module._resolveLookupPaths (module.js:263:17)
    at Function.Module._resolveFilename (module.js:330:31)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/share/code/resources/app/out/cli.js:5:1)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Notes

I believe this could also be reproduced on OS X, because I think the OS X file system works similarly to Linux, but I don't have access to a Mac to test it. I was able to verify that this does NOT occur on Windows, because on Windows you can't remove a directory while any Command Prompt windows are open in that directory, and so this bug reproduction fails on step 7 on a Windows machine.

@bpasero
Copy link
Member

bpasero commented Aug 19, 2016

#2259

@bpasero bpasero closed this as completed Aug 19, 2016
@bpasero bpasero added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 19, 2016
@rmunn
Copy link
Contributor Author

rmunn commented Aug 19, 2016

I looked for duplicates before reporting, but missed that one. Sorry.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants