Would be better if the exit command in PowerShell ISE only closed the current tab
In PowerShell ISE, if you invoke the exit command, it closes the entire application regardless of how many tabs you have open. It would be better if the exit command simply closed the current tab (if you have multiple tabs open) or the entire application if you only have one runspace open. This would prevent accidentally closing runspaces that you wanted to go back to just because you used the all-too-familiar exit command.
Also, making this change would address this issue within PowerShell ISE: when you invoke exit, the Runspace.StateChanged event is only fired for the current/active runspace (tab), even if you have multiple tabs open, so all tabs other than the current one that want to do cleanup of some resource when the runspace is closed cannot do so.
See David’s response below
Vandrey Trindade commented
Still nothing about this?
David Wilson commented
I agree, typing 'exit' in the console should not close the whole ISE since the typical user intent is to close the current PowerShell session. I'll make this change at some point in the future unless there is strong objection from others. Before I start doing the work I'll throw out a poll on Twitter to check opinions. Thanks!