How can tell whether a view is being closed by user (^w or click on close button or even file > close all files) versus sublime being shut down. Either case triggers EventListener on_close but I need to distinguish between the two. Is this possible?
Currently, your only way is to launch a child process that checks whether its parent still exists and performs actions when it doesn’t, after which it terminates itself.