The Cursor Agent terminal outputs garbled, truncated, or mistypeset, and many times it's not command failures, but the shell theme is too complex. In particular, Powerlevel10k, fancy prompts, dynamic icons, and the right status bar can interfere with the Agent reading the terminal output.
Determine whether it is a topic problem first
If you run the command manually and it looks normal, but the output in the Agent panel is missing lines, out of order, and the color controller is full of screens, you should first suspect the terminal prompt. The AI Agent needs to parse the command output, and the complex theme will make it treat the decoration information as the real result.
The simplest test is to cut to a clean shell: temporarily open bash, don't load the theme, and let the Cursor Agent run the same command again. If the output is normal, the problem is not in the project code.
Use CURSOR_AGENT to distinguish
The official Cursor documentation mentions that the Agent runtime can be identified by the 'CURSOR_AGENT' environment variable. You can tell in '.zshrc' or '.bashrc': if an agent is detected, skip Powerlevel10k, oh-my-zsh heavy theming, complex right prompt, and leave only the simple PS1.
This doesn't affect your daily terminal experience, it just gives the agent a cleaner environment when executing commands.
Check these items as well
Turn off scripts that automatically output a large number of welcome messages, such as printing system status, random quotes, and package management prompts every time you start up. Check if the command requires interactive input, and if the command keeps waiting for confirmation, the agent may think that there is no output.
For long-log tasks, the agent is required to use parameters such as '--plain', '--no-color', and 'CI=1' to reduce color and animation. For example, test frameworks, build tools, and lint tools usually have ways to turn off color output.
Stable settings
Prepare a simple terminal environment for the agent: short prompts, fewer plugins, fewer welcome messages, and as much as possible plain text for command output. Then troubleshoot the project itself.
This kind of problem is easy to misjudge as "Cursor won't execute commands", but it's just that the terminal is too fancy. The output must be cleaned before the agent can reliably understand the reason for the failure.