I have been seeing this too on windows PowerShell and Command Prompt terminals. After I switched to git bash, I have never since seen the “command not found: q” issue.
However, this seems to be a different terminal bug, because even on git bash, the issue with missing terminal output box still remains.
When the agent tries to reuse previous terminal, sometimes I see no terminal output.