omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

mise activate hook overwritten by starship/zoxide - PATH not updated automatically

Open plgonzalezrx8 opened this issue 1 month ago • 1 comments

System details

Ryzen 3800, 64gb ram, Omarchy latest

What's wrong?

mise activate hook overwritten by starship/zoxide - PATH not updated automatically

Problem

When using mise to manage Python (or other tools), the mise-managed versions are not used by default in new terminal sessions. The system Python takes precedence even though mise is activated.

For example:

$ python --version
Python 3.13.7  # System version, not mise-managed 3.14.0

$ which python
/bin/python  # Should be ~/.local/share/mise/installs/python/...

Root Cause

In ~/.local/share/omarchy/default/bash/init, mise is activated before starship and zoxide:

eval "$(mise activate bash)"    # Line 2
# ...
eval "$(starship init bash)"    # Line 6
# ...
eval "$(zoxide init bash)"      # Line 10

Mise relies on a PROMPT_COMMAND hook (_mise_hook) to dynamically update the PATH. However, starship and zoxide overwrite PROMPT_COMMAND when they initialize, removing mise's hook.

You can verify this by checking PROMPT_COMMAND in a new terminal:

$ echo $PROMPT_COMMAND
__zoxide_hook;starship_precmd   # Notice: _mise_hook is missing

Workaround

Add the following to the end of ~/.bashrc:

# Re-activate mise at end so its hook isn't overwritten by starship/zoxide
eval "$(mise activate bash)"

Optionally, also add this before the Omarchy rc is sourced to ensure mise paths take priority:

export MISE_ACTIVATE_AGGRESSIVE=1

Suggested Fix

Move the mise activation to the end of ~/.local/share/omarchy/default/bash/init, after starship and zoxide:

if command -v starship &> /dev/null; then
  eval "$(starship init bash)"
fi

if command -v zoxide &> /dev/null; then
  eval "$(zoxide init bash)"
fi

# Activate mise LAST so its PROMPT_COMMAND hook isn't overwritten
if command -v mise &> /dev/null; then
  eval "$(mise activate bash)"
fi

Environment

  • Omarchy version: 3.2.1
  • mise version: 2025.11.3

plgonzalezrx8 avatar Nov 29 '25 02:11 plgonzalezrx8

mise is causing so much trouble to package installations... Just take a look at all of the following issues:

#2831 #3528 #3637 #2728

At least for python you should never override system python for a managed one. As the OS needs the system python for various applications and installing packages overriding that just causes the system to use a different instalation that breaks constantly.

We should probably remove the python language from the mise managed ones and just leave uv as the default python manager. If you develop with python you should use virtual environments anyway. This is a very known issue so much that it has seen several PEP trying to resolve this, see https://peps.python.org/pep-0668/ . This PEP however just prevents you from installing external libraries into the system python. I does not prevent you from breaking your OS package managers by overriding the python installation in PATH

Welp, in any way overriding python in PATH like mise does not bring any advantages vs using something like:

 ~ ❯ uv python install python3.14
Installed Python 3.14.0rc3 in 59ms
 + cpython-3.14.0rc3-linux-x86_64-gnu (python3.14)

Then you can access the version you need via:

 ~ ❯ which python
/usr/bin/python

 ~ ❯ which python3.14
/home/michallote/.local/bin/python3.14

 ~ ❯ python3.14
Python 3.14.0rc3 (main, Sep 18 2025, 19:47:22) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

uv even has some other commands to add python to the PATH in a way that only affects the current session. mise does not addresses any of this issues because it handles python like it did when it started out, and is now outdated.

Michallote avatar Nov 30 '25 22:11 Michallote