hey!
I happen to fix a similar issue three weeks ago: it turns out that for me my terminal loaded configurations (for some reason) were causing issues in cursor auto-runned commands.
In my case it was this the problem: GitHub - romkatv/powerlevel10k: A Zsh theme
After a lot of time wasted I finnaly found p10k and and stopped using it, basically just removving it from my .bashrc and .zshrc files.
This can help you guys maybe!