Hey, thanks for the detailed report. This isn’t exactly a bug, it’s how the environment gets picked up.
When Cursor is launched from the GUI (desktop icon), it resolves the environment via a login shell. A login bash reads /etc/profile, ~/.bash_profile, ~/.bash_login, and ~/.profile, but it does not read ~/.bashrc. The bun installer puts BUN_INSTALL/PATH into ~/.bashrc, so the agent can’t see bun and falls back to a manual export before each command (which is what you see in the screenshot). The integrated terminal works because it starts as non-login and sources ~/.bashrc.
Any of these options should fix it:
Add bun to a file that a login shell reads, like ~/.profile (or ~/.bash_profile):
Or add source ~/.bashrc to ~/.bash_profile. Then fully restart Cursor.
2. Launch Cursor from a terminal where bun is already in PATH, e.g. cursor ., so it inherits your shell PATH. 3. Or set it in Settings: terminal.integrated.env.linux → PATH = ${env:HOME}/.bun/bin:${env:PATH} and restart.