lf icon indicating copy to clipboard operation
lf copied to clipboard

on-quit command is not run when terminal is closed

Open NikitaIvanovV opened this issue 2 years ago • 2 comments

Due to this, some cleanup commands are not run.

I tried moving these lines https://github.com/gokcehan/lf/blob/36a7a18316580864f2f2ebd79e9ddae4858f6b60/app.go#L314-L316

into app.quit() method (because it is called on SIGHUP, SIGTERM and other signals) but it did not work to some reason.

NikitaIvanovV avatar May 25 '22 17:05 NikitaIvanovV

I briefly tried moving that snippet into app.quit() and it seemed to work. Can you double-check?

kmarius avatar Jun 16 '22 20:06 kmarius

@kmarius You're right! I've never wrote Go and it turned out that I put the snippet inside a error handler by mistake. Now it does work. However, to some reason, on-quit command gets executed 2 times instead of 1 (which might be undesirable in some cases). Is it because app.quit() is called when the server terminates as well?

NikitaIvanovV avatar Jun 16 '22 22:06 NikitaIvanovV