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

Plugin vagrant-prompt does not work on macOS #12193

Open
alexventuraio opened this issue Feb 3, 2024 · 0 comments
Open

Plugin vagrant-prompt does not work on macOS #12193

alexventuraio opened this issue Feb 3, 2024 · 0 comments

Comments

@alexventuraio
Copy link

Describe the bug

I recently added the vagrant-prompt plugin to the Oh-My-Zsh config in the ~/.zshrc file:

plugins=(git zsh-nvm macos ruby rails bundler brew rake capistrano web-search vagrant vagrant-prompt)

Then added these ENV variables as well:

ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[grey]%}["
ZSH_THEME_VAGRANT_PROMPT_SUFFIX="%{$fg_bold[grey]%}]%{$reset_color%} "
ZSH_THEME_VAGRANT_PROMPT_RUNNING="%{$fg_no_bold[green]%}●"
ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●"
ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●"
ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○"

And finally, added the prompt to my theme as stated here

Now my prompt shows the status of the VM at the end of the prompt but is is wrong:

  • If the VM is turned off, it shows green
  • If the VM is running, it shows green
  • if the VM is suspended, it does not show anything

  • I think that the problem is that the regex does not work anymore because it returns running for both running and not running state.
  • For suspended state, it just do not considere it.

Steps to reproduce

  1. Add the vagrant-prompt plugin to the Oh-My-Zsh config in the ~/.zshrc file:
    plugins=(git zsh-nvm macos ruby rails bundler brew rake capistrano web-search vagrant vagrant-prompt)
  2. Add these ENV variables as well to the same file:
    ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[grey]%}["
    ZSH_THEME_VAGRANT_PROMPT_SUFFIX="%{$fg_bold[grey]%}]%{$reset_color%} "
    ZSH_THEME_VAGRANT_PROMPT_RUNNING="%{$fg_no_bold[green]%}●"
    ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●"
    ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●"
    ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○"
  3. Finally, add the prompt to your oh-my-zsh theme as stated here

Expected behavior

It should show different status colors as for:

  • RUNNING
  • POWEROFF
  • SUSPENDED
  • NOT_CREATED

Screenshots and recordings

Screenshot 2024-02-02 at 18 40 50

OS / Linux distribution

MacOS Sonoma 14.2.1 (23C71)

Zsh version

5.9

Terminal emulator

iTerm2

If using WSL on Windows, which version of WSL

None

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant