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?

1 Like

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.