I found interesting test result.
Below is the diff env:
diff /tmp/env_fish_ctrl_terminal.txt.1 /tmp/env_fish_agent_terminal.txt.1
9a10
> COMPOSER_NO_INTERACTION=1
39c42
< PAGER=less -R
---
> PAGER=head -n 10000 | cat
40a44
> PIP_NO_INPUT=true
70,71c74
< VSCODE_INJECTION=1
it looks like a additional VSCODE_INJECTION env in agent terminal.
And in current version, if I set below option true, it also works, from [BUG] Terminal tool gets stuck after exit code - Bug Reports - Cursor - Community Forum
"terminal.integrated.shellIntegration.enabled": true
But, when I use remote-ssh to ssh to another macos, it looks like not work in remote cursor’s terminal. the remote cursor cannot detect the finish status.