mwjt42
June 30, 2025, 12:39pm
1
Describe the Bug
Cursor Agent is STILL typing the letter ‘q’, causing this stupid terminal error.
However, the most frustrating part is that this hasn’t been resolved yet, despite multiple requests:
Describe the Bug
Everytime the agent tries to run a command, there’s always a pause, and when I skip it, I get this error:
q
zsh: command not found: q
Steps to Reproduce
I’m on a MacOS if that matters. I’m just using Agent mode and chatting away and then when it thinks it needs to run a terminal, that’s where I get the issue. That means I always have to skip, and then get that error so that the agent can continue.
Expected Behavior
It should pause and display that error.
Screenshots / S…
I have the same and you can see its issuing a q to quit the terminal which is not understood -
main >1 *1 !1 q ok base py 10:37:58 AM
zsh: command not found: q
Spurious ‘q’ Command After AI Assistant Terminal Commands
I’m experiencing the same issue with unexpected ‘q’ commands appearing after terminal output. Here’s my detailed experience to add to the existing reports:
My Environment
Remote Server: Linux 5.4.0-215-generic #235-Ubuntu (accessed via SSH)
Remote Shell: zsh 5.8
Cursor Version: 0.50.4 (user setup)
VSCode Version: 1.96.2
Electron: 34.3.4
Node.js: 20.18.3
Local Client OS: Windows 10.0.19045 x64
Connection: Remote SSH…
hey!
I happen to fix a similar issue three weeks ago: it turns out that for me my terminal loaded configurations (for some reason) were causing issues in cursor auto-runned commands.
In my case it was this the problem: GitHub - romkatv/powerlevel10k: A Zsh theme
After a lot of time wasted I finnaly found p10k and and stopped using it, basically just removving it from my .bashrc and .zshrc files.
This can help you guys maybe!
More Precise Solution: Keep Powerlevel10k in IDE Terminal
@BoboChen ’s solution works great, but I found it also disables Powerlevel10k in Cursor’s built-in IDE terminal, which isn’t ideal if you want the full theme experience there.
The Issue with Broad Detection
Using TERM_PROGRAM == "vscode" affects both:
Agent terminals (where we want minimal config)
IDE built-in terminal (where we want full Powerlevel10k)
Bett…
opened 04:39PM - 19 Jun 25 UTC
closed 03:01PM - 23 Jun 25 UTC
Bug
### Describe the bug
**Agent Mode: Terminal hangs due to `zsh: command not foun… d: q` – possibly related to oh-my-zsh**
I'm encountering an issue in Cursor (which runs on VSCode) where the terminal hangs indefinitely after executing a command. It seems the system fails to detect that the previous command has completed.
When skipping the stalled command (by clicking “Skip” in the Cursor chat window), the following message appears:
```
zsh: command not found: q
```
It looks like something is automatically entering `q` after each CLI command execution. This behavior has been discussed on the Cursor Forum and may be related to `oh-my-zsh`.
**Relevant threads:**
* [https://forum.cursor.com/t/agent-not-detecting-that-a-command-has-completed/65052/20](https://forum.cursor.com/t/agent-not-detecting-that-a-command-has-completed/65052/20)
* [https://forum.cursor.com/t/agent-mode-terminal-ignores-zsh-profile-setting-and-forces-bash/68663/10](https://forum.cursor.com/t/agent-mode-terminal-ignores-zsh-profile-setting-and-forces-bash/68663/10)
Some users have suggested workarounds, but none of them have worked for me.
**System Info:**
* Shell: `zsh` with `oh-my-zsh`: 5.9 / current master
* Cursor Version: master
* OS: MacOS
Would appreciate any insights or a fix for this.
### Steps to reproduce
1. Install oh-my-zshell
2. install Cursor (which is VSCode + stuff)
3. go the chat window
4. let it execute a shell command, like "execute 'ps aux'"
### Expected behavior
this stuff not happening
### Screenshots and recordings

### OS / Linux distribution
MacOS
### Zsh version
5.9
### Oh My Zsh version
f802298
### Terminal emulator
iTerm2
### If using WSL on Windows, which version of WSL
None
### Additional context
_No response_
opened 09:15PM - 27 May 25 UTC
Title: run_terminal_cmd tool executes commands in nested shells and appends unwa… nted 'q' command
Description:
The run_terminal_cmd tool in Cursor's agent interface is exhibiting unexpected behavior in how it executes commands:
1. It runs in a zsh shell (evidenced by the 'ken%' prompt)
2. Executes the specified command in a bash shell (confirmed by $SHELL showing /bin/bash)
3. Automatically appends a 'q' command after the specified command, resulting in a "zsh: command not found: q" error
4. There appears to be a short timeout between the command execution and the 'q' command error
Steps to reproduce:
1. Open Cursor
2. Start a conversation with the agent
3. Ask the agent to run any simple command (e.g., "echo $SHELL")
4. Observe the output which will show:
```
ken% echo $SHELL
/bin/bash
ken%
zsh: command not found: q
```
Note: There is a noticeable delay between the command output and the 'q' command error message.
Expected behavior:
- Commands should execute in a single shell environment
- No additional commands should be automatically appended
- Only the actual command output should be displayed
- No artificial delays or timeouts between command execution and completion
Actual behavior:
- Commands execute in a nested zsh/bash environment
- A 'q' command is automatically appended after a short delay
- Shell prompts and error messages are included in the output
- There is an observable timeout between the command execution and the 'q' command error
Environment:
- Cursor version: 0.50.7 (02270c8441bdc4b2fdbc30e6f470a589ec78d600)
- OS: Linux 5.15.167.4-microsoft-standard-WSL2
- Shell: /bin/bash (running in WSL Ubuntu)
Impact:
This behavior makes the command output more verbose than necessary and introduces error messages that could confuse users. It also suggests potential inefficiencies in how commands are being executed through multiple shell layers. The additional timeout adds unnecessary delay to command execution.
Come on team Cursor, this one can’t be too complex to resolve. It’s stalling all Agent-run terminal interactions.
Steps to Reproduce
Ask the agent to do literally anything that involves the terminal using zsh
Expected Behavior
The agent DOES NOT WRITE THE LETTER ‘q’
That’s it!
Screenshots / Screen Recordings
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.1.6 (user setup)
VSCode Version: 1.96.2
Commit: 5b19bac7a947f54e4caa3eb7e4c5fbf832389850
Date: 2025-06-25T02:20:02.577Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor
2 Likes
Hey, the team are actively working on this issue at the moment, and we hope to have this resolved soon!
7 Likes
mwjt42
June 30, 2025, 1:10pm
3
Thanks Dan! Good to hear.
Sorry about the rant…
2 Likes
Also, the problem is that my Windows operating system is not in English, and these symbols are always in the terminal And also often there is an eternal hang often
mwjt42
June 30, 2025, 1:14pm
5
Not sure if that’s the same bug? Can you post a screenshot
This is compounded when the Amazon Q CLI is enabled, which then captures all following terminal requests (Using Amazon Q Developer on the command line - Amazon Q Developer ).
1 Like
BooNoo
July 2, 2025, 11:47am
7
I found problem in oh-my-zsh theme:
(in .zshrc
)
ZSH_THEME=“powerlevel10k/powerlevel10k”
Just replace with:
ZSH_THEME=“robbyrussell”
(maybe beed to update omz too)
I’ve just upgraded to version 1.2 (released July 3), and it looks like the bug is now resolved. Appreciate the great work—thank you!
1 Like
I still get the error… frustrating indeed. I think Claude thinks it’s simulating a manual EOF (End of File) via Ctrl+D But in PowerShell (windows), ^D
isn’t a real keystroke — it’s just text (q^D
), which throws a command-not-found error
I Tried giving it explicit instructions not to use q^D but it doesn’t care!
mwjt42
July 7, 2025, 8:33pm
10
@danperks it’s back… v1.2.2 - please help!
Not sure if this helps—I’m still on v1.2.1. I found that if I turn off “Auto” for the agent and manually select Claude 4 Sonnet in Cursor, I can see the error. However, if I leave the agent setting on “Auto,” I don’t get any errors—it works fine.
mwjt42
July 11, 2025, 11:10am
12
v1.2.4 - even Grok 4 is introducing the unnecessary ‘q’ using ZSH.
@danperks @deanrie I thought this was resolved!
geodox
July 12, 2025, 8:56pm
13
@danperks Any update on this? Some users are reporting it was resolved, some are reporting it was reintroduced?
T1000
July 16, 2025, 1:50pm
14
Hi everyone here, the issue is being worked on by Cursor Team.
I think we also have a few duplicate posts on this so the efforts on communicating this everywhere becomes a bit more tricky.
here are similar cases
1 Like