1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-05 03:13:14 +00:00

docs(python): Remove a bad config example in the python (#5830)

docs(python): Remove a bad config example in the python

Running a unknown binary in a subfolder (called `.venv/bin/python`) has at least two drawbacks with some security implication:

- In case of a unknown directory, simply cd'ing into a subdirectory could lead to starship executing a unknown binary (usually the binary MUST be in path so it's a decision taken by the user, e.g. by activating the venv)
 - starship would show the result of the venv python even if the venv is not active but calling `python3` on the cli would NOT run that `python3` in the venv but a different one (most likely the system python3).
This commit is contained in:
Jan Katins 2024-03-09 08:08:29 +01:00 committed by GitHub
parent c34e00cd3e
commit 3949697c0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3508,7 +3508,7 @@ current [Python virtual environment](https://docs.python.org/tutorial/venv.html)
If `pyenv_version_name` is set to `true`, it will display the pyenv version
name. Otherwise, it will display the version number from `python --version`.
By default the module will be shown if any of the following conditions are met:
By default, the module will be shown if any of the following conditions are met:
- The current directory contains a `.python-version` file
- The current directory contains a `Pipfile` file
@ -3590,17 +3590,6 @@ python_binary = 'python3'
detect_extensions = []
```
```toml
# ~/.config/starship.toml
[python]
# Display the version of python from inside a local venv.
#
# Note this will only work when the venv is inside the project and it will only
# work in the directory that contains the venv dir but maybe this is ok?
python_binary = ['./venv/bin/python', 'python', 'python3', 'python2']
```
## R
The `rlang` module shows the currently installed version of [R](https://www.r-project.org/). The module will be shown if