First time I’ve encountered this problem was when I was developing tagbar.kak. The thing is, that in Tmux, tagbar.kak behaves like a sidebar, and when main client exits, there’s no point of having
tagbar open anymore. I’ve developed some hooks, that check on client close, that if the only client left is
tagbar, it tries to exit himself. But if there’s unsaved changes it can’t do this. Now there’s also kaktree, which also acts as a side panel. And when main client is exited, I have both
kaktree tmux panes opened. I also like to spawn tools client for things like grep and others, and if I exit main client, I’ll have three panes left. I hope you see the problem.
I’ve thought about a list of tool related clients, but it doesn’t seem to solve anything. I’ve also thought about list of regular clients, that is managed by Kakoune, e.g. regular clients (which are not tool clients) are added to the list, and you can’t kill main kakoune client if any of those clients have unsaved states. But that’s kinda complicated.
The main problem though is that I want regular client to fail to exit in case if there are no regular clients left, but there’s plenty of tool clients, and some buffers have unsaved states.