The X11 repl is unique in that it sends the selection (or parameter) with a
new line appended.
This patch removes that new line and thus, brings it into line with the tmux
and kitty versions.
tmux-send-text allows sending an argument, when supplied the argument
will be sent to the REPL instead of the current selection.
tmux-send-text also keeps kak focussed, which does not happen in the x11
variant as it uses xdotool to switch window.
this patch allows:
* Passing an argument to x11-send-text, so that value will be sent
instead of the current selection.
* We capture the window id of the current (presumably kak window)
before we use xdotool to switch window. We can therefore switch back to
kak afterwards (which we do)
When $1 or ${kak_selection} start with dash, like "-1", the command will fail, because tmux think it's an argument flag.
-- prevent this.
Also the doc (append new line) is no longer valid.
Now it uses the window id to identify the REPL window. It is stored in
the option x11_repl_id. That way it is possible to have different REPLs
for different buffers or windows.
It's unclear what the `send-text` alias does at first glance,
so prefixing it with "repl-" both fixes that and helps make it
discoverable via the command prompt's fuzzy matcher.
The `repl` alias also seems too generic a name, the "-new" suffix
should hopefully give a hint that it creates a new window.
This commit removes attempts to auto-detect the version of the local
Tmux binary.
The Tmux package that ships with OpenBSD doesn't have a version
number[1], and therefore doesn't provide any way to check if it's
compatible with the REPL module, making the feature disabled by
default in that distribution.
Fixes#3237.
[1] https://github.com/tmux/tmux/issues/1141#issuecomment-340244302