Since xonsh xontribs are not compiled unlike the .py ones, so take slower to start https://github.com/xonsh/xonsh/issues/3953, it might make sense to rewrite this xontrib in Python?
I've taken a stab at it by changing the pyenv version (and the langenv_common) in this fork https://github.com/eugenesvk/xontrib-langenv/tree/repy, besides conversion I've also didn't understand why there is a need to search for tools themselves (not their shims) that are supposed to be in PATH already if they're properly installed, so just replaced it ;) with a lazy search of known xonsh binaries
upd: seems to be working, also https://github.com/dyuri/xontrib-langenv/issues/14 is fixed
However, I don't get how source-bash works, it doesn't print anything even in the regular subprocess, e.g. source-bash --suppress-skip-message -n "echo 1" doesn't print 1, so in the create_alias function when you do pyenv shell which ultimately goes to source-bash to source echo $PYTHON_VERSION, nothing is printed even if said variable exists
Since xonsh xontribs are not compiled unlike the .py ones, so take slower to start https://github.com/xonsh/xonsh/issues/3953, it might make sense to rewrite this xontrib in Python?
I've taken a stab at it by changing the
pyenv
version (and thelangenv_common
) in this fork https://github.com/eugenesvk/xontrib-langenv/tree/repy, besides conversion I've also didn't understand why there is a need to search for tools themselves (not their shims) that are supposed to be in PATH already if they're properly installed, so just replaced it ;) with a lazy search of known xonsh binariesupd: seems to be working, also https://github.com/dyuri/xontrib-langenv/issues/14 is fixed However, I don't get how
source-bash
works, it doesn't print anything even in the regular subprocess, e.g.source-bash --suppress-skip-message -n "echo 1"
doesn't print1
, so in thecreate_alias
function when you dopyenv shell
which ultimately goes tosource-bash
to sourceecho $PYTHON_VERSION
, nothing is printed even if said variable existsasked this question in xonsh discussions https://github.com/xonsh/xonsh/discussions/5019