alexherbo2 / kakoune.cr

A command-line tool for Kakoune
https://kakoune.org
The Unlicense
54 stars 11 forks source link

`connect terminal-popup kcr fzf buffers` doesn't work #33

Open sucrecacao opened 2 years ago

sucrecacao commented 2 years ago

A few example in kcr tldr use the command connect terminal-popup which doesn't work for me ( no such command ) I have to use connect-terminal instead

stacyharper commented 2 years ago

Yes this isnt merged upstream but there is some scripts you could add to your kakoune configs:

# windowing/tmux.kak

…
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{@}
}
…
alias global terminal-popup tmux-terminal-popup
…
alexherbo2 commented 2 years ago

The connect command is not required in alacritty.kak and tmux.kak.

I think to remove the connect command—the terminal commands should let know they run from Kakoune.

I’m not sure about the correct environment variable names to export: KAKOUNE_SESSION and KAKOUNE_CLIENT—which come from kak_session and kak_client—might be too generic.

When the terminal spawns, it has these two environment variables set.

KAKOUNE_CLIENT feels off, as it doesn’t represent the client.

A more correct name could be KAKOUNE_OPENER_CLIENT—like Chrome with openerTabId.

We can also not export the client information and infer the client to connect to.