{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/8237","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/8237/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8237/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/8237/events","html_url":"https://github.com/nodejs/node/issues/8237","id":172704729,"number":8237,"title":"process.cwd() casing inconsistent across platforms","user":{"login":"Urthen","id":458614,"avatar_url":"https://avatars.githubusercontent.com/u/458614?v=3","gravatar_id":"","url":"https://api.github.com/users/Urthen","html_url":"https://github.com/Urthen","followers_url":"https://api.github.com/users/Urthen/followers","following_url":"https://api.github.com/users/Urthen/following{/other_user}","gists_url":"https://api.github.com/users/Urthen/gists{/gist_id}","starred_url":"https://api.github.com/users/Urthen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Urthen/subscriptions","organizations_url":"https://api.github.com/users/Urthen/orgs","repos_url":"https://api.github.com/users/Urthen/repos","events_url":"https://api.github.com/users/Urthen/events{/privacy}","received_events_url":"https://api.github.com/users/Urthen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/libuv","name":"libuv","color":"bfd4f2"},{"url":"https://api.github.com/repos/nodejs/node/labels/process","name":"process","color":"00aaff"},{"url":"https://api.github.com/repos/nodejs/node/labels/windows","name":"windows","color":"9944dd"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-08-23T13:51:18Z","updated_at":"2016-08-23T18:22:11Z","closed_at":null,"body":"* **Version:** Node 6.4\r\n* **Platform:** OSX, Windows 10 64bit\r\n* **Subsystems:** process, path\r\n\r\nIn various case-insensitive platforms - namely, Windows and OSX - it is possible to `cd` into an incorrectly-cased path. Node handles this differently on Windows than it does in OSX when attempting to resolve `process.cwd()`. This affects other modules - namely, how `path.resolve()` cases its absolute paths. \r\n\r\nIn OSX, `process.cwd()` resolves to the correctly cased path, regardless of which path you have `cd`ed into. I believe this to be correct behavior.\r\n\r\n```\r\n~/my-app$ node\r\n> process.cwd()\r\n'/Users/michael.pratt/my-app`\r\n~/my-app$ cd ../My-app\r\n~/My-app$ node\r\n> process.cwd()\r\n'/Users/michael.pratt/my-app`\r\n```\r\n\r\nIn Windows default console, it is not possible to `cd` into an incorrect path. However, using PowerShell or the new Bash for Windows, it *is* possible, but `process.cwd()` resolves to the *incorrect* path casing - not matching what is on disk.\r\n\r\n```\r\nPS C:\\Users\\Michael Pratt\\my-app> node             \r\n> process.cwd()                                   \r\n'C:\\\\Users\\\\Michael Pratt\\\\my-app'                 \r\nPS C:\\Users\\Michael Pratt\\my-app> cd ../My-app   \r\nPS C:\\Users\\Michael Pratt\\My-app> node             \r\n> process.cwd()                                   \r\n 'C:\\\\Users\\\\Michael Pratt\\\\My-app'  \r\n```               \r\n\r\nAgain, I feel the OSX behavior is correct, as it matches what is on the filesystem."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/241826770","html_url":"https://github.com/nodejs/node/issues/8237#issuecomment-241826770","issue_url":"https://api.github.com/repos/nodejs/node/issues/8237","id":241826770,"user":{"login":"seishun","id":988441,"avatar_url":"https://avatars.githubusercontent.com/u/988441?v=3","gravatar_id":"","url":"https://api.github.com/users/seishun","html_url":"https://github.com/seishun","followers_url":"https://api.github.com/users/seishun/followers","following_url":"https://api.github.com/users/seishun/following{/other_user}","gists_url":"https://api.github.com/users/seishun/gists{/gist_id}","starred_url":"https://api.github.com/users/seishun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seishun/subscriptions","organizations_url":"https://api.github.com/users/seishun/orgs","repos_url":"https://api.github.com/users/seishun/repos","events_url":"https://api.github.com/users/seishun/events{/privacy}","received_events_url":"https://api.github.com/users/seishun/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T18:22:11Z","updated_at":"2016-08-23T18:22:11Z","body":">However, if you then (following the example above, assuming you're in Powershell) did cd ../../desktop/link and performed the same Node commands, you would report 'C:\\\\Users\\\\Nikolai\\\\desktop\\\\link' \r\n\r\nThat's the path you `cd`'d into, no surprises here.\r\n\r\n>and'C:\\\\Users\\\\Nikolai\\\\desktop\\\\real'.\r\n\r\nNow that's the issue with `realpath` I mentioned before, and a bug in my books. Feel free to submit an issue about it (although I'm not sure if there is a non-massively-breaking way to fix it)."}}
{"actor":{"display_login":"seishun"}}