Cursor Agent shell commands not working in devcontainer

Hi Cursor team,

I’m having an issue with Cursor Agent inside a Dev Container.

Commands like:

find /workspace/projects/AIonDevice/apps -name '*.py' -type f | wc -l

work correctly in the terminal and on the host machine, but when executed by Cursor Agent inside the container, they return no output.

It seems related to shell pipelines, stdout handling, or non-interactive shell execution in devcontainers.

Could you help check if this is a known issue or recommend any settings/workarounds?

Thanks!

This is my output in hostmachine:

My output inside devcontainer: it hang a time

Ubuntu: 24.04
Cursor: 3.3.30

Host machine using zsh
DevContainer using bash

This log in devcontainer

Hey, thanks for the report and the logs. They show the root cause: the error ENOENT, syscall: 'spawn zsh', path: 'zsh' means the agent is trying to run commands via zsh inside the devcontainer, but you only have bash installed there. The spawn fails immediately, the agent gets empty output, and that’s why commands look like they’re hanging.

This is a known bug on our side. In some cases the agent shell is hardcoded to zsh and doesn’t respect the environment’s default shell. No ETA for a fix yet.

Workarounds, from most reliable to least:

  1. Install zsh in the container. This is the most stable option. In your Dockerfile or postCreateCommand in .devcontainer/devcontainer.json:
    apt-get update && apt-get install -y zsh
    
  2. Enable Legacy Terminal Tool. Go to Cursor Settings, search for terminal, then enable Legacy Terminal Tool. It uses a different launch mechanism and usually respects the system SHELL.
  3. Run critical commands manually in the integrated terminal. You have bash there so it works, then paste the result back to the agent in chat.

Let me know which option works for you, and if we have updates on the fix we’ll post them in this thread.

Hey @bleach3269,
Just checking in — are you still running into the shell command issue in devcontainers? We’ve shipped some terminal-related fixes since this was reported. If you’re still hitting it, let me know your current Cursor version and whether the workarounds from the earlier reply helped.

Hi @mohitjain ,

I still encountered similar issue when using Cursor Editor window, and the version infos are list below:

summary

Version: 3.7.12 (Universal)

VS Code Extension API: 1.105.1

Commit: b887a26c4f70bd8136bfffeda812b24194ec9ce0

Date: 2026-06-05T01:45:12.918Z (3 days ago)

Layout: editor

Build Type: Stable

Release Track: Default

Electron: 39.8.1

Chromium: 142.0.7444.265

Node.js: 22.22.1

V8: 14.2.231.22-electron.0

xterm.js: 6.1.0-beta.256

OS: Darwin arm64 25.3.0

And my dev container didn’t have zsh installed when the issue occurred. So it appears to be the same error.

However, the earlier workaround “Enable Legacy Terminal Tool” did work after restart Cursor.

Hey @Yuxuan_Liu thanks for the detailed version info, and good to hear the Legacy Terminal Tool option sorted it out for you after a restart.

You’ve got it exactly right: this is the same issue. When the container’s shell setting points to zsh but only bash is installed, the agent’s shell fails to launch and commands come back empty. It’s a known issue, and your confirmation that it’s still happening on 3.7.12 is a useful data point for us.

For anyone else landing here, the two reliable fixes are:

  1. Install zsh in the container — add apt-get update && apt-get install -y zsh to your Dockerfile or the postCreateCommand in .devcontainer/devcontainer.json.

  2. Enable the Legacy Terminal Tool — in Cursor Settings, search for “terminal”, toggle it on, and restart Cursor (as Yuxuan found, the restart matters).