Warning messages when running claude in agent mode

When claude in agent mode runs a command, I see such warning below. I believe this is because of it uses zsh instead of bash? I tried several methods but couldn’t fix it.

$source ~/.bashrc && source /shared/zhenyus/venv_qwen/bin/activate
.bashrc:13: command not found: shopt
.bashrc:21: command not found: shopt
.bashrc:84: command not found: shopt
/usr/share/bash-completion/bash_completion:45: command not found: shopt
/usr/share/bash-completion/bash_completion:53: command not found: complete
/usr/share/bash-completion/bash_completion:56: command not found: complete
/usr/share/bash-completion/bash_completion:59: command not found: complete
/usr/share/bash-completion/bash_completion:62: command not found: complete
/usr/share/bash-completion/bash_completion:65: command not found: complete
/usr/share/bash-completion/bash_completion:68: command not found: complete
/usr/share/bash-completion/bash_completion:71: command not found: complete
/usr/share/bash-completion/bash_completion:74: command not found: complete
/usr/share/bash-completion/bash_completion:77: command not found: complete
/usr/share/bash-completion/bash_completion:80: command not found: complete

Hey, this looks like you have some bash scripts installed, but Cursor isn’t running bash when it’s executing terminal commands.

A good test to confirm this is to ask the agent to run echo $SHELL to see what shell it is running.

If you are on MacOS, it’s likely zsh which cannot natively run bash scripts like the ones you seen in this errors.

An easy fix would be to find what is running those commands when a terminal starts up (likely a .zshrc file) and changing the line:
source ~/.bashrc
to
[ -n "$BASH_VERSION" ] && source ~/.bashrc

Let me know how you get on with this!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.