Cursor not using bun

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The cursor agent seems to not be able to use bun (bun.com). It fallbacks to manually exporting it to PATH every time.

Steps to Reproduce

Install ubuntu 26.04 (also tested on fedora & arch linux)
Install bun with their install script
Install cursor
Verify that bun is in path in ~/.bashrc

$ cat ~/.bashrc | grep bun

response:

# bun
export BUN_INSTALL="$HOME/.bun"

Use bun package manager in project
Start agent
Agent is not able to use bun directly by running bun

Expected Behavior

agent should be able to call the bun command

Screenshots / Screen Recordings

Operating System

Linux

Version Information

Newest version, in both vscode ide and new app

For AI issues: which model did you use?

Any model

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

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:

  1. Add bun to a file that a login shell reads, like ~/.profile (or ~/.bash_profile):
   export BUN_INSTALL="$HOME/.bun"
   export PATH="$BUN_INSTALL/bin:$PATH"

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.

Let me know if it still doesn’t work.