-
Notifications
You must be signed in to change notification settings - Fork 847
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
Show the PHP version in the CLI prompt #2650
Comments
+1 for this,
|
@pentatonicfunk is this a vote for starship or a vote for the PHP version in the prompt specifically? I've been hesitant to suggest changes to the prompt in the past as it's something very personal to each developer, but I realise there are usability concerns unique to VVV |
We already print some data on Vagrant to help debugging and I don't see an issue on the message at the login similar. Maybe it's the case to do a recap of what is enabled like for the extensions? maybe it's a text message that we can generate on provisioning to simplify it. |
true, but what prompted this was that someone changed into a site that used PHP 8 and expected that Starship has this prompt for me locally: We could use that project, or we could use something else to achieve the same goal, but it is helpful to see the current PHP version inside PHP project folders |
It may even be helpful to indicate the current site, e.g. if you go into |
If we did use starship, I'd suggest the no nerd font preset or the plaintext symbols: https://starship.rs/presets/no-nerd-font.html https://starship.rs/presets/plain-text.html
|
Ahhh ok you were talking about the statusline/prompt in the bash terminal not on the hello message by SSH. I use on my workstation this https://github.com/petobens/trueline (pure bash) loaded on my bashrc with custom settings. Maybe we can use this or similar as they simplify a lot of things and put our script to generate the text like php version.
|
Starship has a powerline style prompt too, perhaps we should provide this as a default and allow configuration via shell:
prompt: starship or shell:
prompt: trueline This also puts a place we can have options for the welcome message e.g. if people would prefer not to have one, or want a slimmed down message. Would we want to install them all and have script files that set up the prompt, then in |
We might also want to add a secondary folder to check for so that users can add their own via extensions, then we'd only need to bundle a single option in VVV core |
Maybe this can be an extension and not native in VVV? About shartship or trueline to me the solution is not a problem. The important part that is easy to update as we want just to show the php version and the git branch. Because it is possible to share the host user .bashrc with ssh https://serverfault.com/questions/400522/how-to-use-a-custom-bashrc-file-on-ssh-login so I don't think that we want to complicate things too much.
|
That just copies bashrc into the remote server which wouldn't work if it's including other files. It would also replace any VVV specific things we have. Additionally, I mention starship or another similar prompt as it's a package that does everything out of the box and maintained by other people. The alternative is we modify the prompt we already have but then we have a bespoke prompt that we need to maintain ourselves. The other problem is that any extension would need to reach into the |
Noting that auto-switching PHP version via |
We should show the PHP version in the terminal prompt when you SSH into the VM so it's clear which version is being used. This also avoids confusion when people go to their site and expect PHP to be the version from the
config.yml
file and for the version to have automatically switched ( we don't have anything that does that currently ).I use starship locally which does this and also prints out info on ruby/node etc depending on the current project folder, and some basic git info. Perhaps that would be a useful addition?
The text was updated successfully, but these errors were encountered: