How to make an agent stick to a selected terminal? (not creating new one on each tool call)

When developing, the agent opens a new terminal tab every time it calls a tool—like running an app for testing. This quickly fills up with tabs, and then you have to close them all or figure out which one is actually running your app.

I’ve tried: passing specific terminal windows as context, using cursor rules, even explicitly telling the agent to use a named terminal window in the prompt—none of it worked.

Is there any way to force the agent to reuse the same terminal window for all actions, instead of opening a new one each time?

2 Likes

Same issue here, it just keeps starting new terminal regardless of what I tell it :frowning:

1 Like

Cursor really need to implement a fix for this, a stateful/ persistent terminal for the AI agent would be a game-changer for complex automated tasks.

1 Like

I’ve also been unable to persist the same terminal in chat, which is a blocker for multi-step workflows. The other rules are being picked up from my .mdc files but any workflow that requires a cd command breaks when it hits this limitation

For FE/BE work I’m so shocked this still isn’t fixed