{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/5464","repository_url":"https://api.github.com/repos/fish-shell/fish-shell","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/5464/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/5464/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/5464/events","html_url":"https://github.com/fish-shell/fish-shell/issues/5464","id":395249406,"node_id":"MDU6SXNzdWUzOTUyNDk0MDY=","number":5464,"title":"Unexpected $PATH contents when using fish as the vim shell","user":{"login":"dalizard","id":148763,"node_id":"MDQ6VXNlcjE0ODc2Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/148763?v=4","gravatar_id":"","url":"https://api.github.com/users/dalizard","html_url":"https://github.com/dalizard","followers_url":"https://api.github.com/users/dalizard/followers","following_url":"https://api.github.com/users/dalizard/following{/other_user}","gists_url":"https://api.github.com/users/dalizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dalizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalizard/subscriptions","organizations_url":"https://api.github.com/users/dalizard/orgs","repos_url":"https://api.github.com/users/dalizard/repos","events_url":"https://api.github.com/users/dalizard/events{/privacy}","received_events_url":"https://api.github.com/users/dalizard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-01-02T13:33:05Z","updated_at":"2019-01-03T09:47:12Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPlease tell us which fish version you are using by executing the following:\r\n\r\n  fish --version\r\n  echo $version\r\n\r\nPlease tell us which operating system and terminal you are using. The output of `uname -a` and `echo $TERM` may be helpful in this regard although other commands might be relevant in your specific situation.\r\n\r\nPlease tell us if you tried fish without third-party customizations by executing this command and whether it affected the behavior you are reporting:\r\n\r\n  sh -c 'env HOME=$(mktemp -d) fish'\r\n\r\nTell us how to reproduce the problem. Including an asciinema.org recording is useful for problems that involve the visual display of fish output such as its prompt.\r\n-->\r\n\r\n\r\nHello,\r\n\r\nBefore I go into the actual problem, here's my context:\r\n\r\n- macOS Mojave 10.14.2\r\n- fish version 3.0.0\r\n- chruby 0.3.9\r\n- macOS Terminal.app with default settings\r\n- vim 8.0\r\n\r\n```\r\n~ $ cat ~/.config/fish/config.fish\r\nsource /usr/local/share/chruby/chruby.fish\r\nsource /usr/local/share/chruby/auto.fish\r\n```\r\n\r\nWhen I launch Terminal.app, I get the following:\r\n```\r\n~ $ echo $PATH\r\n/Users/dimitar/.gem/ruby/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin\r\n```\r\nwhich is expected - Ruby paths should be in the beginning. However, after launching vim (`$ /usr/bin/vim -u NONE`) and executing `!echo $PATH`, I get:\r\n```\r\n/usr/local/bin /usr/bin /bin /usr/sbin /sbin /Users/dimitar/.gem/ruby/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/bin\r\n```\r\nwhich is not expected - Ruby paths are now at the end. I've also reproduced the problem with:\r\n```\r\n~ $ sh -c 'env HOME=$(mktemp -d) fish'\r\nWelcome to fish, the friendly interactive shell\r\ndimitar@Smeagol /U/dimitar> echo $PATH\r\n/usr/local/bin /usr/bin /bin /usr/sbin /sbin /Users/dimitar/.gem/ruby/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/bin\r\n```\r\n\r\nAny ideas what might be causing this issue and how to fix it? For the record, if I change the shell to Bash in vim (`set shell=/bin/bash`) the problem is no longer present - `!echo $PATH` in vim returns:\r\n```\r\n/Users/dimitar/.gem/ruby/2.6.0/bin:/Users/dimitar/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/bin:/Users/dimitar/.rubies/ruby-2.6.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/451095983","html_url":"https://github.com/fish-shell/fish-shell/issues/5464#issuecomment-451095983","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/5464","id":451095983,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTA5NTk4Mw==","user":{"login":"dalizard","id":148763,"node_id":"MDQ6VXNlcjE0ODc2Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/148763?v=4","gravatar_id":"","url":"https://api.github.com/users/dalizard","html_url":"https://github.com/dalizard","followers_url":"https://api.github.com/users/dalizard/followers","following_url":"https://api.github.com/users/dalizard/following{/other_user}","gists_url":"https://api.github.com/users/dalizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dalizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalizard/subscriptions","organizations_url":"https://api.github.com/users/dalizard/orgs","repos_url":"https://api.github.com/users/dalizard/repos","events_url":"https://api.github.com/users/dalizard/events{/privacy}","received_events_url":"https://api.github.com/users/dalizard/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T09:47:12Z","updated_at":"2019-01-03T09:47:12Z","author_association":"NONE","body":"> What happens if inside fish, you launch a child fish? Which $PATH does that get?\r\n\r\nIt gets the Ruby paths in the beginning. The expected behaviour.\r\n\r\n> Is your SHELL environment variable set to fish?\r\n\r\nYes, it is.\r\n\r\n> but I'm guessing that there is an early abort or similar that checks for interactive mode\r\nNope. I've pasted above what I have in `config.fish`:\r\n```\r\n~ $ cat ~/.config/fish/config.fish\r\nsource /usr/local/share/chruby/chruby.fish\r\nsource /usr/local/share/chruby/auto.fish\r\n```\r\nI've also checked [`chruby.fish`](https://github.com/JeanMertz/chruby-fish/blob/master/share/chruby/chruby.fish) and [`auto.fish`](https://github.com/JeanMertz/chruby-fish/blob/master/share/chruby/auto.fish) for anything suspicious, but haven't found anything.\r\n\r\nMy issue is that I have not touched my configuration and this setup used to work with no issues. I've upgraded fish to 3.0.0 and now it's broken. I am not sure why though - because the previous behaviour of fish was erroneous and now it's fixed or because a bug has been introduced. There might be something in the way vim executes external commands, but I am not sure what. Once again:\r\n\r\n- The `config.fish` file contains only the 2 `source` entries above. The _chruby_ Ruby version manager is looking for a _.ruby_version_ file to pick the correct Ruby version.\r\n- If I run vim with no plugins (`vim -u NONE`) and set the shell to Bash (`:set shell=/bin/bash`), and run `:!echo $PATH`, I get the correct _PATH_:\r\n```\r\n/Users/dimitar/.gem/ruby/2.6.0/bin:/Users/dimitar/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/bin:/Users/dimitar/.rubies/ruby-2.6.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:\r\n/sbin\r\n```\r\n- If I run vim with no plugins (`vim -u NONE`) and set the shell to Fish (`:set shell=/usr/local/bin/fish`), and run `:!echo $PATH`, I get the incorrect _PATH_:\r\n```\r\n/usr/local/bin /usr/bin /bin /usr/sbin /sbin /Users/dimitar/.gem/ruby/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/bin /Users/dimitar/.rubies/ruby-2.6.\r\n0/bin\r\n```"}}
{"actor":{"display_login":"dalizard"}}