Issue has been identified and a fix is being made. It will be rolled out with the next update of SSMS 18.
-MatteoNICHOLAS W CARPENDER commented
I am having the same issue. You can hit esc a couple of time to exit the error and keep you query.