Ответсообщение недоступно
The reason it starts terminal and it closes is because the code is done running and the process that was created is closed.
So you can run your code through way I highlighted in my early message and that way your output can be kept on your terminal so you can see and it doesn't close