Brainstorm: create one window manger to rules them all

Since kak doesn’t support windows, some plugin ( thinking of nerdtree ) rely on tmux, kitty or i3 or else to manage multiple windows.

I was thinking to build an API that all those pluging can rely on. ( let’s call it kak_win )

The API will have a config variable holding the user’s window managing choice: tmux, kitty, i3 etc …
and a few fonction that pluging can call: kak_win_hsplit kak_win_vsplit kak_win_newtab etc…

The implementation would be something like ( pseudocode):

void kak_win_hsplit(config):
    switch config.window_manager:
          case 'tmux' :  // call tmux horizontal split
          case 'i3' : // call i3 horizontal split

Something like this was discussed before: https://github.com/mawww/kakoune/issues/2814

The problem is that many tools define very different capabilities of creating windows below, to the right, above, to the left, with set size and so on. For example in Tmux we can tightly control placement, and in GNU Screen we can’t create side by side windows (without a patch). In bspwm it is possible to decide where window should be, but I’m not sure if this applies to, say, gnome. So this is deep topic.

I believe it can be solved by creating a plugin that will handle all possible cases and then try to merge it to upstream.