-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add virtualenv prompt for robbyrussell theme #2060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
1ec8f9d
ec85f44
bb28d5f
11eb0c1
3858be6
f002dfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -625,3 +625,14 @@ function _save-and-reload-history() { | |
| local autosave=${1:-0} | ||
| [[ $autosave -eq 1 ]] && history -a && history -c && history -r | ||
| } | ||
|
|
||
| function venv_prompt() { | ||
| local python_venv="" | ||
| if [[ -n "${CONDA_DEFAULT_ENV:-}" ]]; then | ||
| python_venv="${CONDA_DEFAULT_ENV}" | ||
| PYTHON_VENV_CHAR=${CONDA_PYTHON_VENV_CHAR} | ||
| elif [[ -n "${VIRTUAL_ENV:-}" ]]; then | ||
| python_venv="${VIRTUAL_ENV##*/}" | ||
| fi | ||
| [[ -n "${python_venv}" ]] && echo "${PYTHON_VENV_CHAR}${python_venv}" | ||
| } | ||
|
Comment on lines
629
to
614
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function should probably live closer to the existing functions. NOTE: The spirit of the methods that live in this base theme is to use the I think this function just becomes:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @petarnikolovski, want to continue and improve this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @NoahGorny Sorry for the late response, I will make moves on improvement soon, I couldn't manage because of my work schedule. |
||
Uh oh!
There was an error while loading. Please reload this page.