Daniel Hahler
8ca45c0e0a
init: fix shell detection when invoked from a script
...
- fixes `ps` command to lookup parent process
- adds `assert_output_contains_not` test helper
Ref: https://github.com/yyuu/pyenv/issues/373
2015-06-26 20:47:08 +02:00
Yamashita, Yuu
0ca01826e8
Merge pull request #78 from blueyed/shell-no-note-if-init
...
activate: do not display note if initialized already
2015-05-17 12:23:37 +09:00
Yamashita, Yuu
4fa9c7b220
Merge pull request #75 from blueyed/fix-zsh-typeset-precmd_functions
...
Use `typeset -g` with `precmd_functions`
2015-05-17 12:12:12 +09:00
Daniel Hahler
2571a2b973
activate: display setup instructions only with PYENV_VIRTUALENV_INIT=0
...
This fixes displaying the note, in case "init" has been run manually
and/or the init is not in the expected place.
It removes the unnecessary calls to "grep".
pyenv-virtualenv-init will look at `$PYENV_SHELL` now, too.
Tests have been adjusted/fixed.
2015-05-10 17:47:46 +02:00
Josh Hagins
5953ddaf64
Ignore failure of pyenv activate
...
When the current pyenv environment is not a virtualenv, this line
exits with a return code of 1. This is annoying for those of us
who report the last return code in our own PROMPT_COMMAND, so
ignore the output of `pyenv activate` if we're not currently using
a virtualenv.
2015-03-18 22:30:19 -04:00
Daniel Hahler
2ab9483116
Use typeset -g with precmd_functions
...
This makes it possible to use `eval "$(pyenv virtualenv-init -)"` from a
function.
2015-03-14 02:37:14 +01:00
Tony Wang
e04a6f88fe
fix wrong output in test in fish, refs 240a1de
...
"(any command)" is not supported in test in fish, we have to set a
variable and then use that
2015-01-06 11:10:43 +08:00
Tony Wang
240a1de6e5
fix warns for virtualenv-init corner case on fish
...
The situation is when in a directory containing python binary,
`pyenv prefix' will return empty (caused by `pyenv which' returning
"./python"). This change adds quotes for `test', otherwise `test' will
warn about missing argument.
2015-01-05 23:23:43 +08:00
Tony Wang
f681df6f20
fix incorrect fish syntax in pyenv-virtualenv-init
2014-12-16 17:53:26 +08:00
Yamashita Yuu
e774464ced
ignore error from pyenv-version-name since it might fail if there is configuration error ( yyuu/pyenv#291 )
2014-12-14 14:15:18 +09:00
Yamashita Yuu
2060c43387
Stop buzzy errors from embeded shell functions
2014-10-27 10:36:10 +09:00
Yamashita Yuu
d6671249b7
Should not persist PYENV_DEACTIVATE after automatic deactivation ( #47 , #48 )
2014-10-12 21:34:18 +09:00
Beau Barker
79bfc9d362
When changing from a virtualenv to "system", unset PYENV_DEACTIVATE. Previously the var remained set, which made it impossible to reactivate the previous virtualenv
2014-09-17 19:50:41 +10:00
Pedro Algarvio
81736da905
Indent to 2 spaces.
2014-08-13 19:51:22 +01:00
Pedro Algarvio
3ebb00414f
if [ pyenv deactivate --no-error --verbose ] is not bourne shell compatible
2014-08-13 03:40:02 +01:00
Pedro Algarvio
2662b5807c
Fix weird bash code issue which made bash complain about "then"
2014-08-13 00:55:04 +01:00
Yamashita Yuu
6b4d6249a0
No need to use eval in fish init script
2014-07-05 07:27:12 +09:00
Yamashita Yuu
0de2cdbbc3
Should not persist PYENV_DEACTIVATE after failed attempt to deactivate and activate
2014-07-05 06:53:46 +09:00
Yamashita Yuu
abfda4bac9
Fix issues with manual activation of virtual environments ( #34 )
2014-07-04 22:55:06 +09:00
Yamashita Yuu
d4ce853e94
Display information on automatic (de)?activation
2014-07-04 22:44:05 +09:00
Yamashita Yuu
08b4c94f85
Use PYENV_DEACTIVATE to store which virtualenv has been deactivated ( #32 )
2014-06-30 23:03:37 +09:00
Yamashita Yuu
7079cbe979
Fix broken setenv in pyenv-virtualenv-init
2014-06-30 21:35:53 +09:00
Yamashita Yuu
d9e3adc108
Performe as same as before v20140614 if pyenv virtualenv-init is not configured ( #26 )
2014-06-15 16:43:50 +09:00
Yamashita Yuu
21e999cc7c
Fix deactivation issue with system version
...
$ pyenv global system
$ pyenv shell venv
(venv) $ pyenv shell --unset
(venv) $ pyenv version
system (set by /home/yamashita/.pyenv/version)
(venv) $ pyenv which python
/home/yamashita/.pyenv/versions/venv/bin/python # <-- should be `/usr/bin/python` (system)
2014-06-13 19:30:37 +09:00
Yamashita Yuu
ea120da0c5
fish: Suppress annoying stderr outputs from pyenv-sh-activate
2014-06-04 15:24:34 +09:00
Yamashita Yuu
af6c157a79
Add eval "$(pyenv virtualenv-init -)" to setup _precmd_ for user's shell
2014-06-04 15:24:12 +09:00