Commit graph

16 commits

Author SHA1 Message Date
Jason Karns
8eb97549e1
Conforms OLD_RBENV_VERSION to RBENV_* convention
Keeping rbenv-controlled variables to RBENV_* "namespace" helps with
discoverability (and tools like rbenv-env) but also consistency and a
very minor degree of safety/isolation from env impact.
2016-12-19 17:21:45 -05:00
Mislav Marohnić
c4d97ad392 Finalize rbenv shell - implementation
This ensures that OLD_RBENV_VERSION is never exported. This makes the
implementation a little bit more complex, since more logic needs to be
pushed down into eval'd code.
2016-11-25 20:24:16 +01:00
Aaron Patterson
6a912bf104 add support for rbenv shell -
`rbenv shell -` allows you to switch to the previously activated ruby
version.  Similar to `cd -` or `git checkout -`.

This tries to implement `rbenv shell -` as proposed in #854.  However,
adding support seemed to break the "shell change version" test.  I'm not
very good at Bash programming, can someone tell me what is wrong with
what I'm doing?  I'd like to add a bit more functionality to this, but
I'm really just cargo cult programming Bash.

Thank you!

fix tests
2016-01-12 15:32:59 -08:00
Mislav Marohnić
878bd87328 reliably detect parent shell in rbenv init
`$SHELL` variable is a terrible way of detecting the current shell
because it's not even supposed to reflect the current shell; it's meant
for keeping the value of the default shell for programs to start.

If an explicit `<shell>` argument wasn't passed to `rbenv init`, it
tries to detect the shell by getting the name of its parent process. If
this fails, it falls back on the value of `$SHELL` as before.

Furthermore, `rbenv init` will set the RBENV_SHELL variable in the
current shell to the value of the detected shell so that `sh-shell` and
`sh-rehash` commands don't have to repeat the detection.
2013-10-07 03:24:45 +02:00
Yamashita Yuu
5bfec84432 add fish shell support 2013-09-28 16:11:02 +02:00
Sam Stephenson
149f4b4607 "per-project" -> "application-specific" 2013-01-03 10:00:10 -06:00
Sam Stephenson
4c19dc22d7 Improve syntax for inline documentation and allow for multi-line usage 2012-12-29 12:06:20 -06:00
Mislav Marohnić
1f7722088d make shell return an error code in case of failure
Fixes #274
2012-12-13 02:58:41 +01:00
Sam Stephenson
b4f8906b24 Update zsh completion adapter 2011-09-13 13:12:04 -05:00
Sam Stephenson
f1ca8906c0 Completions for global, local, prefix, shell 2011-09-13 12:38:34 -05:00
Sam Stephenson
0632325a43 Set RBENV_DEBUG=1 to see what's going on under the hood 2011-09-12 10:11:59 -05:00
Sam Stephenson
76929320c8 Make rbenv-sh-shell consistent with rbenv-local 2011-09-10 20:10:07 -05:00
Joshua Peek
783a5700c4 reset isn't standard 2011-09-09 10:45:23 -05:00
Timothy King
555472210b Adds sh-shell subcommand to unset RBENV_VERSION 2011-09-09 08:22:03 -04:00
Timothy King
39497042bc Adds error handling to rbenv-sh-shell 2011-09-09 08:18:14 -04:00
Joshua Peek
042794b651 use -> shell 2011-09-07 10:26:11 -05:00
Renamed from libexec/rbenv-sh-use (Browse further)