{"action":"created","issue":{"url":"https://api.github.com/repos/morassman/process-palette/issues/8","labels_url":"https://api.github.com/repos/morassman/process-palette/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/morassman/process-palette/issues/8/comments","events_url":"https://api.github.com/repos/morassman/process-palette/issues/8/events","html_url":"https://github.com/morassman/process-palette/issues/8","id":105496361,"number":8,"title":"Processes still running after killing running process in process-palette ","user":{"login":"Pauan","id":97238,"avatar_url":"https://avatars.githubusercontent.com/u/97238?v=3","gravatar_id":"","url":"https://api.github.com/users/Pauan","html_url":"https://github.com/Pauan","followers_url":"https://api.github.com/users/Pauan/followers","following_url":"https://api.github.com/users/Pauan/following{/other_user}","gists_url":"https://api.github.com/users/Pauan/gists{/gist_id}","starred_url":"https://api.github.com/users/Pauan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pauan/subscriptions","organizations_url":"https://api.github.com/users/Pauan/orgs","repos_url":"https://api.github.com/users/Pauan/repos","events_url":"https://api.github.com/users/Pauan/events{/privacy}","received_events_url":"https://api.github.com/users/Pauan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-09T00:54:15Z","updated_at":"2015-09-11T16:47:49Z","closed_at":null,"body":"I have a command `npm run-script watch` which automatically recompiles my project when any of my files are changed.\r\n\r\nThis is a long-running process that will keep executing until it is manually killed.\r\n\r\nWhen I run it in a terminal, it creates the following processes, in this order:\r\n\r\n```\r\nnpm\r\nsh -c npm install && webpack --watch\r\n```\r\n\r\nWhen I use `Ctrl-C` to kill the process, both processes are killed.\r\n\r\n----\r\n\r\nHowever, when I run the same command in process-palette, the following processes are created:\r\n\r\n```\r\n/bin/sh -c npm run-script watch\r\nnpm\r\nsh -c npm install && webpack --watch\r\n```\r\n\r\nWhen I kill the process in process-palette, it kills this process:\r\n\r\n```\r\n/bin/sh -c npm run-script watch\r\n```\r\n\r\nBut the other 2 are **not** killed:\r\n\r\n```\r\nnpm\r\nsh -c npm install && webpack --watch\r\n```\r\n\r\nIf I try running it again, it creates new processes, so now there are even more unused processes:\r\n\r\n```\r\nnpm\r\nsh -c npm install && webpack --watch\r\nnpm\r\nsh -c npm install && webpack --watch\r\n```\r\n\r\nLeaking processes like this is bad.\r\n\r\n----\r\n\r\nSome additional information: I'm on Debian GNU/Linux 64-bit.\r\n\r\nAtom version 1.0.11, process-palette version 0.4.12\r\n\r\nThis is the parent-child relationship of the processes:\r\n\r\n```\r\n/usr/share/atom/atom\r\n|__ /bin/sh -c npm run-script watch\r\n   |__ npm\r\n      |__ sh -c npm install && webpack --watch\r\n```"},"comment":{"url":"https://api.github.com/repos/morassman/process-palette/issues/comments/139595972","html_url":"https://github.com/morassman/process-palette/issues/8#issuecomment-139595972","issue_url":"https://api.github.com/repos/morassman/process-palette/issues/8","id":139595972,"user":{"login":"morassman","id":13697130,"avatar_url":"https://avatars.githubusercontent.com/u/13697130?v=3","gravatar_id":"","url":"https://api.github.com/users/morassman","html_url":"https://github.com/morassman","followers_url":"https://api.github.com/users/morassman/followers","following_url":"https://api.github.com/users/morassman/following{/other_user}","gists_url":"https://api.github.com/users/morassman/gists{/gist_id}","starred_url":"https://api.github.com/users/morassman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morassman/subscriptions","organizations_url":"https://api.github.com/users/morassman/orgs","repos_url":"https://api.github.com/users/morassman/repos","events_url":"https://api.github.com/users/morassman/events{/privacy}","received_events_url":"https://api.github.com/users/morassman/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T16:47:49Z","updated_at":"2015-09-11T16:47:49Z","body":"I've implemented a solution that I've tested on OSX 10.10.4 and Ubuntu 14.04. It ensures that the child processes are killed along with the parent process. It works for this particular case, \"commandA && commandB\".\r\n\r\nWhat it doesn't work for are commands that are run with \"command&\". I'm struggling to get the process IDs of child processes spawned in this way. One thing that I've tried is to kill the processes with the same group ID, but that turned out terminating Atom as a whole. For now I'm logging this as a known issue.\r\n\r\nPlease test with v0.5.0 and let me know if you are now able to terminate the process tree. I will close this issue once I know the solution works for you."}}