Describe the Bug
Agent mode automatically executes commands in a terminal. These commands also add to user’s global bash history. When a user press UP + Enter in terminal to execute the “last” command, it may accidentally execute the wrong command added by agent mode.
This behavior may cause serious issues such as user data loss, sensitive information leakage.
Steps to Reproduce
- Ask the Agent to clean unused temporary files in project.
- User runs command (e.g.
./some_other_work.sh
) in a terminal. - Agent automatically runs
rm -rf *
command in project temp dir. This is OK, but addsrm -rf *
to user’s bash history. - After two seconds, user need to run
./some_other_work.sh
again. So he press UP key then Enter key without confirmation (this is very common). But actually runsrm -rf *
and loses all his source code.
Expected Behavior
Agent should run in a “sandbox” terminal, without changing user’s global bash history.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.0.0
VSCode Version: 1.96.2
Commit: 53b99ce608cba35127ae3a050c1738a959750860
Date: 2025-06-04T19:21:22.523Z
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.0.0
Does this stop you from using Cursor
No - Cursor works, but with this issue