1

Allow me to first address this: I am not asking "powershell close when script finish running". I know a lot of people are asking about this, but that have nothing to do with this question.

In ubuntu, terminal will prompt user to confirm the close of a terminal window if something is still running, so that user will not terminate their script by mistake. I've long been benefit from this mechanism.

Does powershell have similar setting? How to enable it?

Edit: I'm using powershell as a terminal, I may running a python script, powershell script or something else other than a script.

And although powershell does not accept the alt+F4 shortcut, powershell ISE does, still with no user prompt. And the whole powershell ISE can even exit entirely by simply typing 'exit' in one powershell tab within the ISE. Is there a way to prevent this?

Misairu
  • 11
  • 3
  • I don't believe there is any way for you to capture the actual close button due to encapsulation bla bla bla, maybe someone has a workaround. You can easily trap ctrl+c, however, if that helps. http://stackoverflow.com/questions/1710698/gracefully-stopping-in-powershell – Jacob Colvin Apr 26 '17 at 18:59

0 Answers0