mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.83k stars 710 forks source link

[REQUEST] alacritty repl/windowing on macOS #4965

Open rosingrind opened 1 year ago

rosingrind commented 1 year ago

Feature

Add detection of alacritty for at least commands like :terminal or :new to work on macOS. An example of my workaround for current support of creating a new alacritty macOS tab and running a command in it (this part of script may be not correct, but it works):

define-command -params 1.. terminal %{
    set-register x %arg{@}
    nop %sh{
        args=$kak_quoted_reg_x
        unset kak_quoted_reg_x

        alacritty msg create-window --working-directory "$(pwd)" -e zsh -ic "$args"
    }
}

As I see in rc/windowing, alacritty is detected at least in x11, but not on any other platforms/wm (am I right?):

https://github.com/mawww/kakoune/blob/e4d7b884cde18ec19375cdd0de159822e4d43493/rc/windowing/x11.kak#L15

I suppose that there isn't any terminal command defined for it yet because alacritty and kak is not meant to be used without tmux/zellij/tiling wm, but I myself use them pretty raw on macOS (I wish I could roll i3, but it is what it is). This snippet allows me to integrate tools such as tig as explained in wiki: https://github.com/mawww/kakoune/wiki/Git-integration-via-Tig

Usecase

mawww commented 1 year ago

Sounds like what we really need is a macos.kak windowing module similar to the x11 one. Terminal detect would look pretty much the same (although the list of terminals to look for would be different) but the focus implementation will be macos specific. I wonder if we should try to merge the shared logic between x11.kak, wayland.kak and the suggested macos.kak