Skip to content
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

Displayed Python Version Incorrect (alias not resolved) #632

Closed
whateverforever opened this issue Nov 7, 2019 · 2 comments
Closed

Displayed Python Version Incorrect (alias not resolved) #632

whateverforever opened this issue Nov 7, 2019 · 2 comments
Labels
🐛 bug Something isn't working as expected. ✅ existing workaround When there is an unofficial way to solve an issue and there is no fix in starship yet.

Comments

@whateverforever
Copy link

Bug Report

Current Behavior

The python version displayed isn't correct. It displays the default version that came with my OS.

Expected Behavior

I expect it to show the actual python version that would be used if I were to run python xyz.py at this moment. (3.6.7 in this case).

Additional context/Screenshots

Capture d’écran 2019-11-07 à 22 15 01

Environment

  • Starship version: starship 0.26.2
  • Shell type: zsh
  • Shell version: zsh 5.3 (x86_64-apple-darwin18.0)
  • Shell plugin manager: oh-my-zsh
  • Terminal emulator: Terminal.app
  • Operating system: macOS 10.14.5 (18F132)

Relevant Shell Configuration

export ZSH=/.../*snip*/.../.oh-my-zsh
plugins=(git)
source $ZSH/oh-my-zsh.sh

alias venv="source .venv/bin/activate || echo 'No venv found in dir'"

eval "$(nodenv init -)"

alias python="python3"

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

source /.../*snip*/.../conda.sh

eval "$(starship init zsh)"

Starship Configuration

add_newline = false

[directory]
truncate_to_repo = false

[line_break]
disabled = true

Possible Solution

It has problems with the alias. If I remove it, I get the correct behaviour:

~ via 🐍 v2.7.10 ❯ python --version
Python 2.7.10
~ via 🐍 v2.7.10 ❯ 
@whateverforever whateverforever added the 🐛 bug Something isn't working as expected. label Nov 7, 2019
@BasixKOR
Copy link
Contributor

BasixKOR commented Mar 6, 2020

Aliases are not searched by utils::exec_cmd because std::process::Command::new(..) only looks for PATH variable. Personally I don't think std should resolve aliases since they are shell features, so fix for this has to be done for every shell starship supports.

@andytom andytom added the ✅ existing workaround When there is an unofficial way to solve an issue and there is no fix in starship yet. label Jun 14, 2020
@andytom
Copy link
Member

andytom commented Aug 29, 2020

Similar to #652, I'm going to close this since I don't think we are going to be able to resolve aliases (at least not in the near future) and we have a work around for this, #652 (comment).

@andytom andytom closed this as completed Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected. ✅ existing workaround When there is an unofficial way to solve an issue and there is no fix in starship yet.
Projects
None yet
Development

No branches or pull requests

3 participants