# Cursor Agent is not using the default shell

**URL:** <https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361>\
**Category:** Bug Reports\
**Created:** [January 22, 2025, 1:44am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361 "2025-01-22T01:44:20Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![tchopra17](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tchopra17/32/17976_2.png) [@tchopra17](https://forum.cursor.com/u/tchopra17)\
**Post date:** [January 22, 2025, 1:44am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/1 "2025-01-22T01:44:20Z")

</div>

I’ve tried the various solutions on this forum to get the agent to use the terminal but it’s not using the default profile within cursor or the mac’s default one. I’ve tried various solutions across the forums to no avail.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [January 22, 2025, 4:37am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/2 "2025-01-22T04:37:49Z")

</div>

Hey, what solutions have you already tried? And what shell does Composer use, and which one is your default?

---

<div class="post-metadata">

**Author:** ![erispoe](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/erispoe/32/22237_2.png) [@erispoe](https://forum.cursor.com/u/erispoe)\
**Post date:** [January 25, 2025, 6:07pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/3 "2025-01-25T18:07:45Z")

</div>

Would also love to know how to setup the shell path for the agent.

---

<div class="post-metadata">

**Author:** ![tchopra17](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tchopra17/32/17976_2.png) [@tchopra17](https://forum.cursor.com/u/tchopra17)\
**Post date:** [January 27, 2025, 5:10am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/4 "2025-01-27T05:10:08Z")

</div>

I tried using the suggestions to set my default shell within the VSCode settings. My default one there is set to my system zsh shell. If I invoke it within the Cursor terminal, I have my normal packages like Node, etc. anything I’ve installed outside of Cursor. Composer says it uses zsh too but it cannot access any of the things I’ve installed in my normal zsh shell. Is there a way I can compare them easily?

---

<div class="post-metadata">

**Author:** ![tchopra17](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tchopra17/32/17976_2.png) [@tchopra17](https://forum.cursor.com/u/tchopra17)\
**Post date:** [January 27, 2025, 5:13am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/5 "2025-01-27T05:13:18Z")

</div>

I asked composer to compare the terminals:

Let me compare the two shell environments in detail:

- Common Characteristics:

- Both use /bin/zsh as shell

- Both use xterm-256color terminal type

- Both run under user tusharchopra

- Both have same encoding and locale settings

1. Key Differences:

- TTY:

- Your terminal: /dev/ttys002

- Cursor shell: /dev/ttys008

- PID:

- Your terminal: 17682

- Cursor shell: 26541

- Shell Version:

- Your terminal: ZSH 5.9

- Cursor shell: Version not explicitly shown

- Additional Environment in Your Terminal:

- Oh My Zsh configuration: ZSH=/Users/tusharchopra/.oh-my-zsh

- Conda setup: CONDA\_EXE, CONDA\_PYTHON\_EXE

- NVM (Node Version Manager): NVM\_DIR, NVM\_CD\_FLAGS

- Homebrew configuration: HOMEBREW\_CELLAR, HOMEBREW\_PREFIX

- Custom color settings: LSCOLORS, LS\_COLORS

- PowerLine9k settings: P9K\_SSH, P9K\_TTY

- PNPM configuration: PNPM\_HOME

1. Cursor-Specific Environment:

- Git integration through Cursor

- VSCode/Cursor specific variables

- More limited PATH variable

- No shell customization tools visible

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [January 27, 2025, 5:22am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/6 "2025-01-27T05:22:58Z")

</div>

That’s strange. Does this also happen in a new session? Can you reproduce it? What responses does the model give, and what questions are you asking it? Can you share screenshots if possible?

---

<div class="post-metadata">

**Author:** ![ashigirl96](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/ashigirl96/32/22643_2.png) [@ashigirl96](https://forum.cursor.com/u/ashigirl96)\
**Post date:** [January 27, 2025, 6:17pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/7 "2025-01-27T18:17:48Z")

</div>

@tchopra17

Hello, I also encountered a similar problem.

When I checked the shell that the cursor agent was using, I found:

```auto
> echo $SHELL
/bin/zsh
> echo $0
/opt/homebrew/bin/bash

```

Oh, that’s strange. For some reason, bash was being executed.

In my case, installing `direnv` via Homebrew installed Homebrew’s version of bash, and for some reason, it took precedence.

I’m not sure what the root cause was, but running

```auto
brew uninstall --ignore-dependencies bash

```

resolved the issue.

---

<div class="post-metadata">

**Author:** ![tchopra17](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tchopra17/32/17976_2.png) [@tchopra17](https://forum.cursor.com/u/tchopra17)\
**Post date:** [January 27, 2025, 9:03pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/8 "2025-01-27T21:03:30Z")

</div>

It happens in every session, persisting through reboots, updates, etc. I’m asking it do basic things like perform migrations, run tests and analyze results, install packages. In this image you can see it trying to run the various commands. Each of those commands are available in my regular shell env.

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/5/7/57fada9c9d711f8ad47b348ff2a0137315897b3e.png)

---

<div class="post-metadata">

**Author:** ![tchopra17](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tchopra17/32/17976_2.png) [@tchopra17](https://forum.cursor.com/u/tchopra17)\
**Post date:** [January 27, 2025, 11:59pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/9 "2025-01-27T23:59:02Z")

</div>

> [@ashigirl96](#):
>
> `echo $0`

interestingly echo $0 is giving me bash as well, but the brew command you posted doesn’t work for me. will try to identify why this is happening. thanks!

---

<div class="post-metadata">

**Author:** ![gopikori](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/gopikori/32/23747_2.png) [@gopikori](https://forum.cursor.com/u/gopikori)\
**Post date:** [February 2, 2025, 2:17am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/10 "2025-02-02T02:17:36Z")

</div>

I am using MacOS and had same issue where composer was using powershell and not bash. Following settings in the settings.json worked for me -

```
"terminal.integrated.automationProfile.osx": {},
"terminal.integrated.defaultProfile.osx": "bash",
"terminal.integrated.shellIntegration.enabled": false,
"terminal.integrated.defaultProfile.linux": "bash"

```

Importantly, it did not work until I set the Linux profile as well to ‘bash’

---

<div class="post-metadata">

**Author:** ![Cohen-Yuval](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/cohen-yuval/32/31704_2.png) [@Cohen-Yuval](https://forum.cursor.com/u/Cohen-Yuval)\
**Post date:** [March 1, 2025, 1:32pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/11 "2025-03-01T13:32:31Z")

</div>

> [@gopikori](#):
>
> ```auto
> "terminal.integrated.automationProfile.osx": {},
> "terminal.integrated.defaultProfile.osx": "bash",
> "terminal.integrated.shellIntegration.enabled": false,
> "terminal.integrated.defaultProfile.linux": "bash"
> 
> ```

Helps only for local project settings  
`.vscode/settings.json`  
, but unfortunately not for the global settings  
`"~/Library/Application Support/Code/User/settings.json"`

---

<div class="post-metadata">

**Author:** ![nicolas-rabault](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/nicolas-rabault/32/51085_2.png) [@nicolas-rabault](https://forum.cursor.com/u/nicolas-rabault)\
**Post date:** [April 30, 2025, 2:04pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/12 "2025-04-30T14:04:07Z")

</div>

Another bad way to work around this is to specify on your prompt to actually use /bin/bash/.  
After a few fails, it should switch to bash. For any command, you will have to skip in the end because the bash process is not returning, but it should be OK…

---

<div class="post-metadata">

**Author:** ![Antonytm](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/antonytm/32/56584_2.png) [@Antonytm](https://forum.cursor.com/u/Antonytm)\
**Post date:** [June 22, 2025, 8:36pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/13 "2025-06-22T20:36:50Z")

</div>

For Windows it always uses bash…  
And fails. And after that, oh, I need to write a command in Powershell

Not cool.

---

<div class="post-metadata">

**Author:** ![cyotee](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/cyotee/32/80003_2.png) [@cyotee](https://forum.cursor.com/u/cyotee)\
**Post date:** [September 17, 2025, 8:20pm UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/14 "2025-09-17T20:20:12Z")

</div>

None of that worked for me.

I keep getting this errore.

> $ echo $SHELL  
> (eval):3: parse error near `cursor\_snap\_ENV\_VARS…’  
> zsh:1: command not found: dump\_zsh\_state

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [December 21, 2025, 8:55am UTC](https://forum.cursor.com/t/cursor-agent-is-not-using-the-default-shell/43361/15 "2025-12-21T08:55:40Z")

</div>

Closed on December 21, 2025, 8:55am UTC

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