What to do when Julia runs away from you? (how to interrupt on C-c?)

I’m currently working on a model that somehow get’s in a solving loop that I can’t cancel with Ctrl+C. To prove this I’m printing to the console from within the while loop that is running away. I can see the print statement reporting the ever increasing index to the console, but my keyboard input of Ctrl+C is ignored. Is there another way to interrupt Julia? My only solution at the moment is to kill Julia, but this is not ideal since I need to spend minutes re-compiling the current project.

I’m not really answering your question, but maybe providing a useful workaround. I find myself frequently in such situations when adding debugging prints to the code. What I do now to avoid having to kill julia, is to add readline() after the debugging print. Control-C after a readline() usually works without major issues.

I remember reding that julia only catches the Control-c on yieldpoints. Because I don’t know enough about this it may fail, but. If you add yield() inside the while. Are you able to interrupt via Control-C?