I had this problem and it turns out it was my oh-my-posh command prompt customization. VS Code injects certain control characters into the output stream for agents to observe events and the theming runs after those mechanics are hooked up so it can interfere. Updating to the latest oh-my-posh fixed it for me.
Here's the oh-my-posh GH issue[0] in case your problem is similar but not solvable with a simple package update.
[0]: https://github.com/JanDeDobbeleer/oh-my-posh/issues/7029
I have the same problem with zsh + powerlevel10k
but surely the issue is on VS Code side, to do things in a way that work with people's shells as they are
other agent harnesses don't have the same problems with my shell
Ive also had huge problems with copilot and terminals, mostly due to corporate antivirus which makes it impossible to install clink for example. So the Shell integration never really worked. It has been fixed for a couple of months though now, and its working, maybe not great but at least very good.
The only sad thing is trying to use tools in a VS developer prompt (and how could this not have been fixed ages ago, its literall YOUR OWN flagship product). It knows how to launch the .cmd for it, but thats incredibly slow for single commands. Would be nice if I could tell it to just use an open terminal.