mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-03 18:38:23 +00:00
fix(python): Fix venv name not showing when using pyenv (#1046)
This fixes an issue where the name of the virtual environment is not being shown when using the `pyenv_version_name` setting.
This commit is contained in:
parent
7c45f74d11
commit
beed0acc6c
@ -47,6 +47,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
|||||||
let python_version = get_python_version()?;
|
let python_version = get_python_version()?;
|
||||||
let formatted_version = format_python_version(&python_version);
|
let formatted_version = format_python_version(&python_version);
|
||||||
module.create_segment("version", &SegmentConfig::new(&formatted_version));
|
module.create_segment("version", &SegmentConfig::new(&formatted_version));
|
||||||
|
};
|
||||||
|
|
||||||
if let Some(virtual_env) = get_python_virtual_env() {
|
if let Some(virtual_env) = get_python_virtual_env() {
|
||||||
module.create_segment(
|
module.create_segment(
|
||||||
@ -54,7 +55,6 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
|||||||
&SegmentConfig::new(&format!(" ({})", virtual_env)),
|
&SegmentConfig::new(&format!(" ({})", virtual_env)),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
Some(module)
|
Some(module)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user