{"action":"created","issue":{"url":"https://api.github.com/repos/shelljs/shelljs/issues/261","labels_url":"https://api.github.com/repos/shelljs/shelljs/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/shelljs/shelljs/issues/261/comments","events_url":"https://api.github.com/repos/shelljs/shelljs/issues/261/events","html_url":"https://github.com/shelljs/shelljs/issues/261","id":122793552,"number":261,"title":"Create isolated shells","user":{"login":"joviwap","id":10451821,"avatar_url":"https://avatars.githubusercontent.com/u/10451821?v=3","gravatar_id":"","url":"https://api.github.com/users/joviwap","html_url":"https://github.com/joviwap","followers_url":"https://api.github.com/users/joviwap/followers","following_url":"https://api.github.com/users/joviwap/following{/other_user}","gists_url":"https://api.github.com/users/joviwap/gists{/gist_id}","starred_url":"https://api.github.com/users/joviwap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joviwap/subscriptions","organizations_url":"https://api.github.com/users/joviwap/orgs","repos_url":"https://api.github.com/users/joviwap/repos","events_url":"https://api.github.com/users/joviwap/events{/privacy}","received_events_url":"https://api.github.com/users/joviwap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-17T18:23:46Z","updated_at":"2015-12-28T09:08:50Z","closed_at":null,"body":"This is more a question than an issue.\r\n\r\nI would like to know if it's possible to create new instances of shelljs in order to have different execution flows. I am creating a bunch of scripts and I would like all the to run at the same time but I am having issues to keep the path stable when to scripts are navigating throw the folders al the same time:\r\n\r\n* Script one: \r\nshell.cd(\"folder1\")\r\nshell.exec(command11)\r\nshell.exec(command12)\r\n\r\n* Script two:\r\nshell.cd(\"folder2\")\r\nshell.exec(command2)\r\n\r\nlets suppose the script \"one\" starts before than the \"two\" and right after starts the other one. What is happening to me is: \"command12\" is being executed on the \"forder2\".\r\n\r\nHow can i solve this issue?\r\nThank you"},"comment":{"url":"https://api.github.com/repos/shelljs/shelljs/issues/comments/167518196","html_url":"https://github.com/shelljs/shelljs/issues/261#issuecomment-167518196","issue_url":"https://api.github.com/repos/shelljs/shelljs/issues/261","id":167518196,"user":{"login":"nfischer","id":5801521,"avatar_url":"https://avatars.githubusercontent.com/u/5801521?v=3","gravatar_id":"","url":"https://api.github.com/users/nfischer","html_url":"https://github.com/nfischer","followers_url":"https://api.github.com/users/nfischer/followers","following_url":"https://api.github.com/users/nfischer/following{/other_user}","gists_url":"https://api.github.com/users/nfischer/gists{/gist_id}","starred_url":"https://api.github.com/users/nfischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfischer/subscriptions","organizations_url":"https://api.github.com/users/nfischer/orgs","repos_url":"https://api.github.com/users/nfischer/repos","events_url":"https://api.github.com/users/nfischer/events{/privacy}","received_events_url":"https://api.github.com/users/nfischer/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T09:08:50Z","updated_at":"2015-12-28T09:08:50Z","body":"Could you give an example of how you're executing these scripts? I'm trying to reproduce the bug, but haven't been able to do so:\r\n\r\n```Bash\r\n$ shjs test1.js & shjs test2.js\r\n```\r\n\r\ntest1.js:\r\n\r\n```Javascript\r\nshell = require('shelljs');\r\nshell.cd('foo/');\r\nshell.exec('pwd');\r\nshell.cd('..');\r\n```\r\n\r\ntest2.js:\r\n\r\n```Javascript\r\nshell = require('shelljs');\r\nshell.cd('bar/');\r\nshell.exec('ls');\r\nshell.cd('..');\r\n```\r\n\r\nHow can I change this so that I see the behavior you're seeing?"}}