Open malte-v opened 3 years ago
The :x11-repl-send-text
command (which is the implementation of repl-send-text
that's used outside tmux and the kitty terminal emulator) works by copying the text to the X11 clipboard, switching the keyboard focus to the target terminal, and sending a <s-insert>
keypress to paste the text from the clipboard into the terminal. If your window manager doesn't allow programs to switch the keyboard focus, the X11 REPL mode is never going to work for you.
Instead, you might like to try running Kakoune inside tmux (to use the tmux REPL implementation), inside kitty (another OpenGL accelerated terminal emulator like Alacritty), or a third-party plugin like kakoune-repl-buffer which tries to provide a REPL inside a Kakoune buffer rather than trying to interface with an external terminal emulator.
I think the problem is that Alacritty somehow doesn't respond to the Shift+Insert
keystroke sent from the script. The following works for me:
xdotool type --window <window id of the REPL terminal> --delay 000000.1 "<expression to be evaluated>"
xdotool key --window <window id of the REPL terminal> Return
Upside is that it doesn't use the clipboard, downside is that it literally types the expression into the terminal; Alacritty can handle a "1 nanosecond" delay though (I doubt that it is actually one nanosecond, but whatever).
Correction: Alacritty does react to Shift+Insert
when typed from a physical keyboard, but not when simulated by xdotool. Other keys, like Return
, work fine.
repl-new ghci
)repl-send-text isometext
*debug*
buffer; dwm highlights the currently active tag (like it highlights the tag with the webbrowser when you click on a link in another program)Kakoune rev: 26cf5cd1dce362a34593fcf5994c961f8aa53bc0 (latest master at the time of writing) Window manager: dwm in X11 Terminal emulator: Alacritty