# Cannot kill Script Console execution

**URL:** <https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 19, 2019, 1:56pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941 "2019-06-19T13:56:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![md.szyman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/md.szyman/32/9240_2.png) [@md.szyman](https://forum.inductiveautomation.com/u/md.szyman)\
**Post date:** [June 19, 2019, 1:56pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/1 "2019-06-19T13:56:17Z")

</div>

In the Designer’s Script Console, there seems to be no way to kill a script running in the Multiline Buffer. I ran into this issue when I accidentally created an infinite loop in some code I was testing, and was unable to kill the execution of this script without completely restarting the Designer.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 19, 2019, 4:03pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/2 "2019-06-19T16:03:26Z")

</div>

This is something we would love to implement, but it’s unfortunately essentially impossible. Because we’re just executing the code you’ve written, it’s extremely easy to write an indefinite loop - and identifying that your code is going to loop indefinitely is the [halting problem](https://en.wikipedia.org/wiki/Halting_problem).

There’s also no mechanism in Java (or most languages) to stop an infinitely running thread once it’s going - even the deprecated `stop()` method on the base Thread class requires the cooperation of the running thread…which obviously it won’t have, because it’s busy running your infinite loop.

---

<div class="post-metadata">

**Author:** ![md.szyman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/md.szyman/32/9240_2.png) [@md.szyman](https://forum.inductiveautomation.com/u/md.szyman)\
**Post date:** [June 19, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/3 "2019-06-19T16:05:07Z")

</div>

I see, gotcha.

Of course I wouldn’t expect the console to detect an infinite loop, but thought it could be possible to implement a stop-button type thing. Didn’t realize there were limitations to doing that.

Thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 1, 2019, 5:33pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/4 "2019-08-01T17:33:40Z")

</div>

So, turns out, I lied, and another developer managed to figure this out 🙂  
Tomorrow’s nightly build should have an interrupt available in the script console.

---

<div class="post-metadata">

**Author:** ![md.szyman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/md.szyman/32/9240_2.png) [@md.szyman](https://forum.inductiveautomation.com/u/md.szyman)\
**Post date:** [August 1, 2019, 5:45pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/5 "2019-08-01T17:45:06Z")

</div>

Eyy, nice! Thanks a bunch!

---

<div class="post-metadata">

**Author:** ![FrankP](https://avatars.discourse-cdn.com/v4/letter/f/34f0e0/32.png) [@FrankP](https://forum.inductiveautomation.com/u/FrankP)\
**Post date:** [November 13, 2019, 6:53pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/6 "2019-11-13T18:53:48Z")

</div>

When will this be available in Ignition 7.9? Thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 13, 2019, 6:56pm UTC](https://forum.inductiveautomation.com/t/cannot-kill-script-console-execution/25941/7 "2019-11-13T18:56:51Z")

</div>

Almost certainly not. It uses some Jython internals that are fundamentally different between 2.7 (what’s included in 8.0) and 2.5, which 7.9 is still using. Upgrading Jython in the 7.9 branch is high risk, low reward for an LTS branch.
