Commit graph

38 commits

Author SHA1 Message Date
Ian Chen
c1674cd552 Detect shell 2022-12-02 00:22:50 +08:00
Isaac Levy
cc56f76733
Add --no-push-path option (#2526)
In some advanced shell setups, the order of custom-added PATH entries is important.
We disregard it by default, always pushing shims to the front of PATH,
to ensure that Pyenv works even in poorly maintained shell environments
and with minimal hassle for non-export users
(an attempt to do the opposite (#1898) has ended in a disaster).
Some advanced users are however ready and able to carefully maintain their environment
and deal with breakages and inconvenience. This option is for them.
2022-11-19 00:01:59 +03:00
native-api
0b5e16add3
Fix invalid syntax error in pyenv init - if PYENV_ROOT has spaces (#2506) 2022-10-29 23:08:02 +03:00
native-api
e676fde990
Fix endless loop in pyenv init - under SSH in some shell setups (#2374) 2022-05-18 16:15:05 +03:00
Ivan Pozdeev
6d4365a696 Make pyenv init --path usable as a pyenv init - substitute
We're going to eliminate the need to mandatorily use `pyenv init --path`.
We can't delete it yet for backward compatibility.
Besides, there's one other use case for it: to enable shims but without
shell integration, e.g. for noninteractive shells.

To be a full-fledged replacement for `pyenv init -` however,
it needs to do rehashing.
2022-05-02 19:07:24 +03:00
Ivan Pozdeev
8439f8e187 Simplify init scheme; update & clarify the README
Now the setup is to add to both rc and profile:
1) set PYENV_ROOT
   (can do it unconditionally -- since if you change it,
   you need to update all places anyway since any of them can be run first)
2) Add `pyenv` to PATH if not already there
3) eval "$(pyenv init -)"

Not a breaking change, old setup will continue to work.
2022-05-02 19:07:24 +03:00
Ivan Pozdeev
eb89256f59 Remove the sample code from pyenv init
since there proved to be to many cases to fit
2021-09-19 00:27:03 +03:00
native-api
f7754ae6a4
Remove PATH warning (#2001)
* In some cases (Ubuntu), `pyenv init -` has to be run before `pyenv init --path`.
* The warning has served its purpose by now.
2021-07-03 09:48:13 +03:00
Hugh Rawlinson
d2bd4c06ef
Suggest that fish users init in interactive mode
...rather than login mode.

I couldn't get rid of the warning that `pyenv init -` no longer sets path until I did this. It looks like setting only on the login shell wasn't enough to hide the warning in other shells I opened. This fits with [how rbenv does the same thing](https://github.com/rbenv/rbenv/blob/master/libexec/rbenv-init#L74).

I'm way out of my depth here, so someone who knows about shell types should definitely review this.
2021-06-27 00:22:59 +02:00
native-api
859b260764
Check for shims in path with pure Bash (#1978)
Closes https://github.com/pyenv/pyenv/issues/1921
2021-06-10 03:51:59 +03:00
Ivan Pozdeev
e0d109c227 Include a Bash automated install option 2021-05-13 22:58:07 +03:00
native-api
0d07cda969
Update install instructions for Bash and Zsh (#1920)
* Update install instructions for Bash and Zsh

* Synchronize README.md with `pyenv init`
* Add a ~/.bash_profile note
* Concatenate shims activation into installation for brevity
  (Pyenv can't be used meaningfully without shims anyway)
  Otherwise, we'd need to duplicate all the ~/.profile shenanigans in both sections
* Update based on feedback
* Proofread
2021-05-13 22:57:14 +03:00
Fabian Homborg
0d2fb35cee
Fix fish installation instructions (#1916) 2021-05-11 22:35:15 +03:00
Ivan Pozdeev
da9392fd09 Add a hint for cases when ~/.profile sources ~/.rc
Our ~/.rc logic must run after the ~/.profile one
2021-05-10 04:39:45 +03:00
Ivan Pozdeev
13deda8875 Place full shell configuration instructions into pyenv init
including initial PATH and PYENV_ROOT entries.
The migration hint proved to be unclear to users without them.
2021-05-10 00:08:46 +03:00
Ivan Pozdeev
aab562c696 Add a warning about needing to restart the entire login session
E.g. for a GUI session, ~/.profile is executed by the GUI login "shell" at its startup
so one needs to fully log out and log back in.
Before that, the change would only be seen by shells explicitly started as login shells.
2021-05-07 16:21:17 +03:00
Ivan Pozdeev
3e3f40fefc Warn users to add pyenv init --path to ~/.profile
To facilitate migration
2021-05-05 03:04:52 +03:00
Ivan Pozdeev
7838707595 Separate startup logic into PATH and the rest
PATH manipulation should be done in ~/.profile rather than ~/.*rc since .rc can be sourced multiple times
2021-05-05 03:04:51 +03:00
Ivan Pozdeev
5998f4f7ab Refactoring: make logic more fit for rearrangement
With functions, we have more leeway in what to call
2021-05-05 01:25:11 +03:00
Ville Skyttä
61d702405d feat(init): strip -<suffix> when autodetecting shell
For example bash-5.1, bash-static.
2021-03-23 22:10:55 +02:00
M. Smits
71d2e4549e
Updated documentation pyenv init for fish shell comform to readme. (#1703) 2020-10-01 21:28:29 -04:00
Andrew Rabert
0f596d2504 Revert "Merge pull request #1153 from cmcginty/remove-sbang"
This reverts commit 070e1c859f, reversing
changes made to 3faeda67bb.
2019-04-23 10:23:33 -04:00
Casey McGinty
83e5459cfb Remove shebang lines from scripts for performance
All scripts in libexec/ (excluding pyenv) are called through pyenv,
therefore the shebang lines are not necessary. On some systems this
provides a measurable increase in performance of the shell prompt.

Related to pyenv/pyenv-virtualenv#259
2019-03-07 22:15:14 +01:00
Yamashita, Yuu
83f97ef2b3 Merge remote-tracking branch 'rbenv/master' into rbenv-20180402 2018-04-02 01:46:48 +00:00
Daniel Hahler
3fd23431af Merge remote-tracking branch 'rbenv/master'
Conflicts:
	README.md
	libexec/pyenv---version
	libexec/pyenv-init
	libexec/rbenv
	libexec/rbenv-sh-shell
	libexec/rbenv-which
	test/init.bats
	test/shell.bats
2017-06-05 15:18:44 +02:00
McTavish McArdle
5f20bc258f "." has been deprecated in the fish shell in favor of explicit "source" 2016-05-28 18:29:45 -04:00
Yamashita, Yuu
41ce3aade2 Merge remote-tracking branch 'rbenv/master' into rbenv-1.0 2016-03-02 01:39:52 +00:00
Yamashita, Yuu
8da3749648 Merge remote-tracking branch 'rbenv/master' into rbenv-20151121 2015-11-21 04:21:14 +00:00
derwolfe
e9aa6cf649 doc: make location to add code to more clear 2015-03-18 21:33:15 +01:00
Yamashita Yuu
f0e852553a Import rbenv changes at 7e0e85bdda 2014-12-01 00:29:26 +09:00
Yamashita Yuu
6f761f8159 Remove exit 0 from initialization code of fish 2014-06-30 23:00:09 +09:00
Yamashita Yuu
5dea3c9e63 Import changes from recent rbenv 2014-01-03 04:58:44 +09:00
Yamashita Yuu
5bff9c773a Reliably detect parent shell in pyenv init (fixes #93)
Imported changes from sstephenson/rbenv#453.
2013-12-26 13:48:43 +09:00
Yamashita Yuu
6e749ef12f Import recent changes relating to fish from rbenv 2013-09-30 18:02:12 +09:00
Yamashita Yuu
93b536863f Support fish shell 2013-08-15 22:56:53 +09:00
Yamashita Yuu
fca31c4307 import trivial changes from rbenv 0.4.0 2013-01-18 19:10:35 +09:00
Yamashita Yuu
da06998457 import rbenv-help from rbenv 0.4.0 2013-01-18 19:09:56 +09:00
Yamashita Yuu
2457419b4a created new project.
modified rbenv source for Python and renamed to pyenv.
2012-08-31 15:30:20 +09:00