When using Cursor’s AI agent to run terminal commands, the agent system sends a stray ‘q’ character to the terminal after command completion, resulting in the error: zsh: command not found: q. This frequently results in cursor hanging waiting for output, and not proceeding with work.
Steps to Reproduce
Open Cursor with a project that has a terminal
Use the AI agent to run terminal commands (e.g., ls, echo "test", etc.)
After command completion, observe the error: zsh: command not found: q
Expected Behavior
Agent terminal commands should execute cleanly without sending stray characters to the shell.
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
OS: Linux (WSL2) - Ubuntu
Cursor Version: 1.2.4 (from TERM_PROGRAM_VERSION)
Shell: zsh 5.8.1
Terminal: xterm-256color
Environment: WSL2 on Windows
Additional Information
Additional Context
This issue only occurs when the AI agent runs commands, not when users interact with the terminal directly
The issue persists regardless of shell configuration (tested with minimal zsh config)
The ‘q’ character appears to be sent by Cursor’s agent terminal integration system
This is not a user shell configuration issue, as it doesn’t occur during normal terminal usage
Impact
Creates noise in terminal output
May interfere with automated scripts or CI/CD processes
Reduces the reliability of agent-executed terminal commands
Workarounds Attempted
Various shell configurations (minimal vs full zsh setup)
Different terminal profiles
Environment variable modifications
Shell aliases (temporary workaround by aliasing ‘q’ to ‘:’)
Request
Please investigate the agent terminal integration system to identify why stray ‘q’ characters are being sent to the terminal after command execution.