Terminal Session Not Persistent in Virtual Environments

When I ask the agent to connect to a virtual environment and then run another command, sometimes it maintains the session, sometimes it doesn’t.

Example:

  1. “Connect to virtual environment” → Agent activates venv
  2. “Run pip install xxx” → Sometimes runs in venv, sometimes in new terminal

Question: How can I make the agent maintain the terminal session until I explicitly tell it to stop?

This happens with Vagrant, Docker containers, etc.