[BUG] Terminal tool gets stuck after exit code

This is happening to me too. Im on windows, using cursor 1.0 and oh-my-posh, the default theme, no extra changes on the vscode settings

Just switch to Copilot, it has zero issues with terminal output

2 Likes

This is what’s happening to me.

I don’t know why these escape sequences just got added in to bash.

I just updated my .zshrc and added this at the top to make my setup simpler when it’s triggered from Cursor.

# ============================================================================
# 🚨 CURSOR/IDE DETECTION - MUST BE FIRST
# ============================================================================
# If running in Cursor or VS Code, use minimal shell and skip fancy features
if [[ $TERM_PROGRAM == "vscode" ]] || [[ $CURSOR_SESSION == "1" ]] || [[ -n $CURSOR_TRACE_ID ]]; then
    # Ultra-minimal shell for IDE integration
    export PS1='$ '
    export PS2=''
    
    # Essential paths
    export PATH=$HOME/bin:/usr/local/bin:$PATH
    export PATH=/opt/homebrew/bin:$PATH
    export PATH=/Users/rhaenyra/.local/bin:$PATH
    export EDITOR="/opt/homebrew/bin/micro"
    
    # Load essential tools (add your tools here)
    export NVM_DIR="$HOME/.nvm"
    [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
    
    return  # Exit early, skip all fancy shell features
fi

Basically, I removed oh my zsh and theming when running from Cursor and it just works. Everything stays the same elsewhere.

1 Like

I think it’s theme that cause the issue. I removed the p10k theming and this issue solved. It works fine now even if I still source oh-my-zsh.sh

Appreciate!

Still having this problem on Mac. Can’t find anything that works :confused:

I turned this into a User Rule:

To reduce hangs, ALWAYS run `powerlevel10k_plugin_unload; unset PROMPT RPROMPT RPS1 RPS2; PS1='%n@%m:%~%# '` in the first terminal before any running any command.

This almost works, but the hang is still encountered when Cursor first runs this command at the start. After that though it works fine.

Of course this doesn’t work… now Cursor is suggesting the above Cursor Rule over actual commands it’s trying to suggest :joy: :melting_face: :sob:

1 Like

same I feel like I spend more time killing have to get the terminal commands to exit

Same here, it’s really annoying :frowning: working in the terminal is sometimes just impossible..

Also, tried the fix @carlosrivera suggested - didn’t help

Same problem here using Windows Powershell. Spamming return inside the tool makes it continue though.

Same problem here using Windows Powershell!!

This is still a problem. Related fully described problem, with additional bugs: