My apologies if I am in the wrong Stack section, if I am please just let me know and I will delete this post.
I am running Perl scripts on my Ubuntu server, 18.04. I run them from my Mac and PC. One of them is a short, repetitive Perl script that relies on an outdated CPAN module, sometimes the app crashes and the SSH (Putty.exe and Terminal) connection just closes.
For the few times when I see the error, I am able to find where it occurred and throw in a "try/catch" statement. But with the window closing, if I am not there, I have no idea where the error is.
Is there a way to keep terminal window from auto-closing?
Yes, both in PuTTY and in GNOME terminal there is an option to prevent window from auto-closing. In PuTTY, it is on the main Session tab, in GNOME terminal, it is on the Command tab. You can set the window to stay open after the script finishes.