Venv doesnt persist in Agent Chat Terminal command runs

Describe the Bug

Cursor Agent Chat terminals are unique for every Run. So, if you have a venv requirement, it will not persist. If you are running a Cursor VSCode Terminal tab, and have a venv activated, any commands being run from chat responses will spawn new independend terminals which will not have the same requirements installed.

Steps to Reproduce

Open a Cursor/VScode terminal window (cmd-j mac). Create a new venv for your python project and activate it. install dependencies from a requirements.txt file. Then, chat the agent and ask it to use any of the dependencies via terminal commands. This may fail since the agent chat’s terminal commands will run in newly spawned teminal sessions, independent of your venv. The workaround is to copy the commands and run them manually. This slows down the agentic flow.

Expected Behavior

There should be an option for Cursor agents to run terminal commands inside the existing spawned session in the Terminal Tab of Cursor/VSCode. This will keep the context of any sourced dependencies of that terminal session.

Operating System

MacOS

Current Cursor Version (Menu β†’ About Cursor β†’ Copy)

Version: 1.2.4
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T16:53:59.659Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.1.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Same. Annoying, would love to see this fixed.

cc @deanrie

1 Like

I run into this a lot as well. I have to stop the agent and remind it to take action in the venv.

An artifact of agetnic coding is its propensity to forget its basis_of_operation – like a venv.

And since I do a lot of things via wrapping the agentic actions in scripts, and TUIs, via .ps1 files - I tell the agent to, when writing the scripts to do a venv check first.

There are a few benefits to this:

  1. I dont like agents just running commands in terminal - so I wrap them in a .ps1 in the scripts\ folder - with proper headers, including a venv check

  2. This logs all their actions intrinsicly into the wrapper scripts.

  3. Standards can be applied to any script / action / milestone – wheres as the .ps1 method means that

A) Check for VENV
b) Logs actions to scripts
c) has logging directives in the .ps1 template
d) has a standard header that has version description invokation etc.

its cumbersome and consumes tokens - but agents are still fn dorks and need a lot of directions