{"action":"created","issue":{"url":"https://api.github.com/repos/sstephenson/rbenv/issues/730","labels_url":"https://api.github.com/repos/sstephenson/rbenv/issues/730/labels{/name}","comments_url":"https://api.github.com/repos/sstephenson/rbenv/issues/730/comments","events_url":"https://api.github.com/repos/sstephenson/rbenv/issues/730/events","html_url":"https://github.com/sstephenson/rbenv/pull/730","id":74926263,"number":730,"title":"Fix shell version when invoked from a script","user":{"login":"blueyed","id":9766,"avatar_url":"https://avatars.githubusercontent.com/u/9766?v=3","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-10T14:04:33Z","updated_at":"2015-10-11T01:30:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sstephenson/rbenv/pulls/730","html_url":"https://github.com/sstephenson/rbenv/pull/730","diff_url":"https://github.com/sstephenson/rbenv/pull/730.diff","patch_url":"https://github.com/sstephenson/rbenv/pull/730.patch"},"body":"When invoked from a shell script, `$(rbenv init -)` did not get the shell name correct.\r\nIt needs to look at the `args` value from `ps`.\r\n\r\nReported for pyenv at: https://github.com/yyuu/pyenv/issues/373"},"comment":{"url":"https://api.github.com/repos/sstephenson/rbenv/issues/comments/147144246","html_url":"https://github.com/sstephenson/rbenv/pull/730#issuecomment-147144246","issue_url":"https://api.github.com/repos/sstephenson/rbenv/issues/730","id":147144246,"user":{"login":"mislav","id":887,"avatar_url":"https://avatars.githubusercontent.com/u/887?v=3","gravatar_id":"","url":"https://api.github.com/users/mislav","html_url":"https://github.com/mislav","followers_url":"https://api.github.com/users/mislav/followers","following_url":"https://api.github.com/users/mislav/following{/other_user}","gists_url":"https://api.github.com/users/mislav/gists{/gist_id}","starred_url":"https://api.github.com/users/mislav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mislav/subscriptions","organizations_url":"https://api.github.com/users/mislav/orgs","repos_url":"https://api.github.com/users/mislav/repos","events_url":"https://api.github.com/users/mislav/events{/privacy}","received_events_url":"https://api.github.com/users/mislav/received_events","type":"User","site_admin":true},"created_at":"2015-10-11T01:30:52Z","updated_at":"2015-10-11T01:30:52Z","body":"On the server, presumably in a non-interactive shell, the preferred approach is to prepend `` `rbenv root`/shims`` to PATH manually instead of invoking `rbenv init` which is only meant for interactive shells.\r\n\r\nMaybe I should detect the interactive state of the current shell and simply not execute any commands that are meant for interactive shells, such as loading completions or defining the `rbenv()` function?"}}