Enterprise
Cursor Agent: The Terminal Tool
Cursor's terminal tool runs shell commands directly in your terminal. Your Run Mode setting controls when a command runs, when Cursor asks first, and when commands go into the sandbox - a restricted environment that blocks unauthorized file access and network activity.
On this page
What is the terminal tool in Cursor's agent?
The terminal tool is how the agent runs shell commands. Cursor runs them directly in your terminal rather than a hidden process, so the output lands where you can read it. What decides whether a command runs on its own, pauses for your approval, or drops into the sandbox is your Run Mode setting, not the terminal tool itself.
When does the agent run a command versus ask first?
That decision lives in Run Mode. Run Mode controls three things for terminal commands: when they run automatically, when Cursor stops and asks you, and when a command enters the sandbox. Set the behavior you want there before you let an agent loose on a repo.
The terminal page points to Run Modes for the full behavior. Check cursor.com/docs/agent/security/run-modes for the current run-and-approval settings before relying on a default.
What does the terminal sandbox restrict?
The sandbox runs terminal commands in a restricted environment that blocks unauthorized file access and network activity. It is the containment layer for commands the agent runs, so a command that tries to reach files or the network it should not touch is stopped.
The deeper sandbox details - platform requirements, network modes, environment variables and the sandbox.json configuration - live in the Run Modes sandboxing section, not on the terminal page. Read that section when you need to tune what the sandbox permits.
Why does the terminal output look truncated or misformatted?
Some shell themes interfere with the inline terminal output. Cursor names Powerlevel9k and Powerlevel10k as examples. If a command's output looks truncated or misformatted, disable the theme or switch to a simpler prompt while Cursor runs.
You do not have to give up your prompt everywhere. Cursor sets the CURSOR_AGENT environment variable when it is running, so you can detect it in your shell config and skip the heavy theme only for Cursor sessions. The zsh snippet below does that for Powerlevel10k.
if [[ -n "$CURSOR_AGENT" ]]; then # Skip theme initialization for better compatibility else [[ -r ~/.p10k.zsh ]] && source ~/.p10k.zsh fi
The same check works in bash if you would rather fall back to a plain prompt for Cursor sessions instead of skipping a theme.
if [[ -n "$CURSOR_AGENT" ]]; then PS1='\u@\h \W \$ ' fi
Frequently asked questions
Does the Cursor agent run commands in its own terminal?
No. Cursor runs shell commands directly in your terminal, with native terminal integration, so the output appears where you would normally see it.
How do I stop the agent from running commands without asking?
Use Run Mode. It controls when commands run, when Cursor asks first, and when a command enters the sandbox. See cursor.com/docs/agent/security/run-modes.
How do I detect when Cursor is running my shell?
Cursor sets the CURSOR_AGENT environment variable. Check for it in your ~/.zshrc or ~/.bashrc to skip a heavy prompt theme when Cursor runs.
Sources & last verified
Cursor ships frequently. Facts verified against primary sources on June 26, 2026.