I do not feel like this should really be fixed.
Jenkins.instance.doExit(null,null); would do the same but make sure to call the right hooks if really one wants to use the script console. But I would strongly discourage using it for this.
In general the script console is a very sharp tool, and people should not expect that using it will always behave always the expected user way. Anything can be done or bypassed using this.
On the other hand: I would definitely consider this a bug if sending a CTRL-C (or a signal using kill) would not correctly call the cleanups. Because using this way *is* the end user way.
I do not feel like this should really be fixed.
Jenkins.instance.doExit(null,null); would do the same but make sure to call the right hooks if really one wants to use the script console. But I would strongly discourage using it for this.
In general the script console is a very sharp tool, and people should not expect that using it will always behave always the expected user way. Anything can be done or bypassed using this.
On the other hand: I would definitely consider this a bug if sending a CTRL-C (or a signal using kill) would not correctly call the cleanups. Because using this way *is* the end user way.