Agent terminal confusion

An issue I am running into a lot is terminal confusion - the agent doesn’t realise which terminal it is currently running in.

For example, when using powershell it often uses && rather than ; for chaining commands.

Other times they open another shell, like an SSL connection or an R terminal, and they lose track of what OS/terminal they are working in.

I have tried to remind the AI using user rules, but I guess this something that could be partly addressed in the back-end prompt etc…

I have something similar where it keeps asking me to run the server either npm build or npm run dev, and i already have it running.