Welcome to the forum.
It would be helpful to see your commandline history,
which would show us what you were doing when this happened.
The next time it happens use F2 to open your commandline history window
and copy to the clipboard the last 12 lines or so, which should be more than enough
to show what you were doing when it happened. Then post it back into this thread to help us to help you get it sorted out.