When using mise with Cursor, you may notice that the mise environment is not activated when Cursor executes shell commands. This occurs because Cursor launches a non-login shell, which initializes differently than an interactive login shell and therefore does not automatically source your usual mise setup.
The Problem
Cursor runs commands in a non-login shell, which means:
- For zsh: Only
.zshenvis loaded (not.zshrc) - For bash: Only
.bash_profileis loaded (not.bashrc)
If you’ve configured mise activation in .zshrc or .zprofile, it won’t be available when Cursor executes commands.
The Solution
The solution is to activate mise in .zshenv (for zsh) or .bash_profile (for bash) when the file is loaded by Cursor. You can detect Cursor by checking for the CURSOR_AGENT environment variable.
Add this to your ~/.zshenv or ~/.bash_profile:
# Activate mise when running in Cursor
if [[ -n "$CURSOR_AGENT" ]]; then
eval "$(mise activate)"
fi
Why This Works
.zshenv(or.bash_profile) is always sourced for non-login shells- The
CURSOR_AGENTenvironment variable is set when Cursor runs commands - By conditionally activating mise only when
CURSOR_AGENTis present, you avoid potential conflicts or slowdowns in other non-login shell contexts - This ensures mise and all its configured tools are available when Cursor executes terminal commands
After adding this configuration, rerun Cursor chats, and mise should be available in all Cursor shell commands.