I’m adding a snippet from the i3 module (https://github.com/Delapouite/kakoune-i3/blob/master/i3.kak) and for the life of me I can’t figure out what’s wrong:
define-command -hidden -params 1.. bspwm-new-impl %{
evaluate-commands %sh{
if [ -z "$kak_opt_termcmd" ]; then
echo "echo -markup '{Error}termcmd option is not set'"
exit
fi
bspwm_split="$1"
shift
# Clone the window with the same buffer, on the same line.
kakoune_args="-e 'execute-keys $@ :buffer <space> %val{buffile} <ret> %val{cursor_line} g'"
{
exec $kak_opt_termcmd "kak -c $kak_session $kakoune_args"
} < /dev/null > /dev/null 2>&1 &
}
}
Running bspw-new-impl temp
works ok. It’s spawns a new terminal with a Kakoune instance. The problem is that it doesn’t connect to the existing session. That means it also can’t open the same buffer and move to the proper line.
Also, what does the shift
line do?
Thank you