starship: Allow Elixir module to use `elixir --short-version` because `elixir --version` is very slow
Feature Request
Is your feature request related to a problem? Please describe.
Requesting the Elixir version can take upwards of 700ms, because elxiir --version starts the entire VM. This can cause the prompt to frequently timeout or seem very slow.
Describe the solution you’d like
Since Elixir v 1.13.0 there is a --short-version switch. This doesn’t start the VM and returns results in less than 10ms, but it can only show the full version of Elixir and not OTP. It would be nice if there was a way to make use of this.
The most complex but exhaustive option would be:
if format configuration does NOT contain "$otp_version"
and the elixir value from the mix.exs file (e.g. elixir: "~>1.13") and that version 1.13 or greater
then use the `--short-version` command
Alternatively simply providing a configuration switch that uses elxiir --short-version, but that would have to come with caveats that it will fail on versions older than 1.13 and will not provide the OTP version.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (1 by maintainers)
also pasted the custom elixir config to get elixir and otp version from asdf
My custom script just in case someone find it useful:
It uses
--short-versionand if that’s not working then it will use--version. It may be slower for old versions, so I guess use it if most of your projects are running 1.13+@kris524 It looks like @DonizeteVida is still working on this.