This question already has an answer here:
I messed up and now terminal closing itself as soon as I open him. I wanted that terminal execute command when it's starts, but I haven't noticed "when command exits" was "close terminal". Now it's closing itself as soon as I open it. How to fix? Reset terminal settings?