Title: Jest tests hang indefinitely in integrated terminal, works fine in external terminal
Description:
Jest test suite runs successfully but the process never exits in Cursor’s integrated terminal. Same tests exit properly in macOS Terminal.app.
What I’ve tried (all failed):
–forceExit flag
–runInBand flag
process.exit(0) in globalTeardown
Spawning Jest as child process with forced exit
Setting TERM=xterm-256color
Clearing Jest cache
Proper cleanup of NestJS testing modules
Impact: Cannot run tests in Cursor’s terminal, must use external terminal.
Note: The process actually completes the tests (I can see the output), it just never exits. This suggests Cursor is preventing process termination, possibly by keeping file descriptors open or intercepting exit signals.
Steps to Reproduce
Open Cursor
Open integrated terminal (zsh)
Run yarn test (or jest --runInBand --forceExit)
Tests complete successfully but process hangs indefinitely
Same command in macOS Terminal.app exits immediately after tests complete
Expected Behavior
I should be able to run
yarn test
which runs jest, multiple times, without force closing cursor completely.
it can run over and over again in the mac terminal, so I’m confused
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Thanks so much for a speedy reply!
1.
Version: 2.1.50
VSCode Version: 1.105.1
Commit: 56f0a83df8e9eb48585fcc4858a9440db4cc7770
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.6.0
It does fire up the tests process under /bin/zsh, but then still just hangs, until I press control + C
OK, tried that, same issue.
Fixes,
Yes, I tried this. Same
That sleep test is fine, I can just keep running it, over and over.3.
Control + C can kill the process, but then it will just hang again, until Cursor is totally restarted.
I really think it’s just got to be my machine right? No way anything is unique about my setup or test right now.
I also tried VS-Code, same issue. So I’m thinking, if it’s not VS-Code/Cursor related, it’s my machine. Weird that a regular mac terminal is fine though.