You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wherever there is a loading screen in patch-hub, if the application crashes due to the working thread panicking, for example, the cursor becomes invisible. The terminal doesn't meltdown like when we crash the application before restoring the terminal, but the cursor only reappears after resetting the terminal or doing a Ctrl+L.
How to reproduce:
Run patch-hub and do a delayed action that involve a loading scree (consult the patchsets of a mailing list)
Before the loading completes, unplug from the network (you can disable WiFi, disable networking, etc.)
Notice that the cursor won't be visible
Expected behavior:
In this case, the terminal should be fully restored if this type of crash occurs.
The loading_screen! macro spawns a new thread to draw the loading screen in the terminal that is finished once the code it wraps finishes. But if this piece of code panics we run our panic hook (utils::install_hooks) before finishing the thread.
Probably the panic hook restores the terminal and then the thread tries to draw again (it will run until the program exists). It probably fails to draw since we already restored but it might hide the cursor.
The solution is kill any running threads at the begging of the panic hook. I think the best way to achieve this is by:
Create a global variable to store the atomic bool used to kill the thread and it's handle
Change the macro to properly set and unset this variable with the created atomic boolean and thread handle
On the panic hook, if the atomic boolean and handle are set, set it to false and join the handle
Description:
Wherever there is a loading screen in
patch-hub
, if the application crashes due to the working thread panicking, for example, the cursor becomes invisible. The terminal doesn't meltdown like when we crash the application before restoring the terminal, but the cursor only reappears after resetting the terminal or doing aCtrl+L
.How to reproduce:
patch-hub
and do a delayed action that involve a loading scree (consult the patchsets of a mailing list)Expected behavior:
In this case, the terminal should be fully restored if this type of crash occurs.
Setup:
The text was updated successfully, but these errors were encountered: