-
Notifications
You must be signed in to change notification settings - Fork 927
[Enhancement] Show python version of conda virtual environment #1053
base: next
Are you sure you want to change the base?
[Enhancement] Show python version of conda virtual environment #1053
Conversation
|
@nipunsadvilkar - It looks to me like you did create a new segment! By moving the code to its own file in The major items remaining for this PR, I think, are:
Do you need help with either of the above? |
|
Yes I would need help in making current scripts correct and writing tests
for them. Once I get that right I will update README.
I would need directions to merge this PR
…On Mon, Nov 5, 2018 at 9:51 PM Ben Hilburn ***@***.***> wrote:
@nipunsadvilkar <https://github.com/nipunsadvilkar> - It looks to me like
you did create a new segment! By moving the code to its own file in
segments/, that's exactly what you've done.
The major items remaining for this PR, I think, are:
1. Updating the README to reflect the new segment
2. Adding tests for the segment.
Do you need help with either of the above?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1053 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOXViCwXB4q5y3aMYORsEiz_hhirGGUpks5usGWIgaJpZM4YOVBS>
.
|
| # Display the current active python version | ||
|
|
||
| prompt_conda_env() { | ||
| if [["${P9K_PYENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is meaningless, isn't it? If you do not set P9K_PYENV_PROMPT_ALWAYS_SHOW to true, you'll never see the segment. This would be the same, as removing it from your configuration..
|
|
||
| prompt_conda_env() { | ||
| if [["${P9K_PYENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then | ||
| conda_py_version=$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| conda_py_version=$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))') | |
| local conda_py_version=$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))') |
| # @description | ||
| # Display the current active python version | ||
|
|
||
| prompt_conda_env() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this segment to something like prompt_python_version.. This is what it does, right? Or is it in it's current form related to conda?
| # Parameters: | ||
| # segment_name context background foreground Generic Flat/Awesome-Patched Awesome-FontConfig Awesome-Mapped-FontConfig NerdFont | ||
| # 🐍 | ||
| p9k::register_segment "CONDA_ENV" "" "blue" "$DEFAULT_COLOR" '' $'\uE63C' $'\uE63C' $'\U1F40D' $'\uE73C ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| p9k::register_segment "CONDA_ENV" "" "blue" "$DEFAULT_COLOR" '' $'\uE63C' $'\uE63C' $'\U1F40D' $'\uE73C ' | |
| p9k::register_segment "PYTHON_VERSION" "" "blue" "$DEFAULT_COLOR" '' $'\uE63C' $'\uE63C' $'\U1F40D' $'\uE73C ' |
|
Regarding the tests: As this is a language segment, we need to mock |
|
Why not just make a file , segments/python_version.p9k: conda virtualenv pyenv all had their own |
|
@cocobear i'm thinking your idea is good and i done it on my powerlevel9k (and 10k) prompt theme. I also try to pull request and we will see: |
Initial setup to show
conda_envsegment