Terminal issue keeps closing

My terminal keeps auto-closing and won’t stay open long enough to do anything. How do we fix this?

hasn’t happened to me in awhile, but
I got it back by doing, command pallet, idx environment rebuild.
or try a reload of the window,