ISISComputingGroup / IBEX

Top level repository for IBEX stories
5 stars 2 forks source link

GUI: Scripts which catch keyboard interrupt with inputs should work #5392

Open John-Holt-Tessella opened 4 years ago

John-Holt-Tessella commented 4 years ago

As a developer I want to write a script such that I catch the keyboard interrupt (ctrl + c) and then can offer an option to the user. Currently this does not work because either the input is ignored or the prompt is not returned to the user. (Only in GUI it works in a console)

Test script:

try:
    while True: pass
except KeyboardInterrupt:
    import time
    time.sleep(0.2)  # comment line for different effect
    a = input("Type something")
    print("You wrote {}".format(a))

If sleep line is in then prompt is not returned, if it is not then input is not taken.

Acceptance Criteria

Notes

DominicOram commented 4 years ago

Is this related to https://github.com/ISISComputingGroup/IBEX/issues/5160?

John-Holt-Tessella commented 4 years ago

Yes but it is different, this is not ctrl +c in the middle of an input.