I am pushing a fix for this with the ScriptEditor
command in Rhino 8
!_NoEcho _-ScriptEditor _Run (
#! python 3
import scriptcontext
import rhinoscriptsyntax as rs
n = 0
limit = 100
while True:
rs.Prompt("test "+str(n)+" of "+str(limit)+" (Press ESC to terminate)")
n += 1
rs.Sleep(100)
if n> limit:
break
if scriptcontext.escape_test(False):
print("ESC pressed")
break #get out of the loop
print("Done")
)