tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
61 stars 8 forks source link

Small fix for wrong behaviour when user interrupts sliding logs #80

Closed panglesd closed 2 years ago

panglesd commented 2 years ago

When the user interrupts by calling Ctrl+c, while the program is writing sliding logs, the result is wrong: previous logs are replaced by the sliding logs, part of the sliding logs are half removed, the prompt is in the middle of half removed logs:
image

This PR fixes this by removing the clear_logs from the things that are executed at the end even in case of interruption: image

I am not completely sure why the former behavior happened consistently (it is like clear_logs was running twice), and how we could achieve what was wanted before (that the sliding logs are removed in case of user interruption), but I think it is good to keep the sliding logs in case of user interruption.