AshlinHarris / Spinners.jl

Command line spinners in Julia with Unicode support
MIT License
13 stars 1 forks source link

Spinner keeps spinning when `expr` fails #62

Open curio-sitas opened 1 year ago

curio-sitas commented 1 year ago

bug2 All is the title. It seems that the cleanup does not occur because the whole spinner process is stopped when expr eval fails.

AshlinHarris commented 1 year ago

Using a try...finally...end block around the user's function changes its scope, which can change its behavior. I think it's most important that @spinner f() always behaves the same as f(), so the user may have to be responsible for the effects of their function. If there's a way around this issue, it would be worth adding to Julia Base. I can add a disclaimer to the README, and at the very least, the spinner process should intercept an InterruptException so that users can terminate it with ctrl+c without quitting the REPL.

AshlinHarris commented 1 year ago

121

AshlinHarris commented 1 year ago

123