Instead of Clicking “Move to Background”, I would suggest to click Skip as the command is already completed but the agent is not able to close the terminal thus getting stuck forever.
Clicking “Skip” most of time ends all the agent’t work, it says “The user has cancelled the command. What do you want to do next?” and sometimes gives a few examples what it can do.
I have found clicking “Move to background” more effective, as the agent immediately continues working on the task without ending.