mawww / kakoune

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

Add support for tmux popups #3878

Open alexherbo2 opened 3 years ago

alexherbo2 commented 3 years ago

Floating scratch terminal in tmux

Example of a use case:

connect tmux-terminal-popup :fzf

It could be nice to introduce the notion of popup commands.

alias global popup tmux-terminal-popup

See https://github.com/wez/wezterm/issues/270.

alexherbo2 commented 3 years ago

I created alacritty.kak supporting alacritty-popup (through class configuration). It is a first step toward it.

vbauerster commented 3 years ago

Implementation candidate:

hook global ModuleLoaded tmux %{
    define-command tmux-terminal-popup -params 1.. -shell-completion -docstring '
    tmux-terminal-popup <program> [<arguments>]: create a new terminal as a tmux popup
    The program passed as argument will be executed in the new popup' \
    %{
        tmux-terminal-impl 'display-popup -E -h 75% -d #{pane_current_path}' %arg{@}
    }
}
alexherbo2 commented 3 years ago

@vbauerster I don’t recall exactly the needed parameters, but from tmux#2475 I needed the following command:

tmux display-popup -d "$PWD" -K -E -R -- sh -c 'some-command "$@"' -- "$@"
vbauerster commented 3 years ago

-K and -R have been removed since then.