Kakoune tmux-repl usage


I am a new Kakoune user and I ran across the tmux-repl-horizontal and the associated Send-text commands. This is great because now I can create my own repl flow similar to the Clojure layer in Spacemacs. However, I need to ask for assistance from you guys on how to achieve the following:

  1. The repl only opens up a shell, is there an environment variable I need to set to have a repl open in the shell? I wan’t to have the shell run this command:
    clojure -Sdeps “{:deps {viebel/klipse-repl {:mvn/version “0.2.3”}}}” -m klipse-repl.main --port 5555

  2. How can I get the text that is sent to the repl to actually execute (pressing Enter)? Right now, It shows up in my repl (that I started manually) but just sits there until I hit enter.

  3. What is the best way to get a return value from the socket repl (sending text to port 5555 in this instance) and displaying it in my text editor until I move my cursor. This is similar to how Geiser and the Clojure Cider layer in Spacemacs work. I can issue this command:
    echo {Text} | nc -N localhost 5555

This gets me a return value and closes the socket connection, but where should I put this information temporarily for the user? It seems like I should use something like the command below, but I am having issues putting it all together:

append command output after each selection.

Then I will need to delete this output after some trigger. Sorry, I know number 3 might be tough to understand.

Thanks for the help!


I’m not sure you can achieve this with the tmux-repl command, as it does not take an argument.

I have made a plugin a while back that you might be able to use for this repl-bridge

I don’t know if it will play nice with your repl, but at least you could look at the source code for hints on how to do the communication between kakoune and the repl, it mostly involves named pipes (FIFOs).

In this case, why distinguish between tmux-repl and tmux-terminal if they both only open a shell?

never mind the first two, I got it to work. I will try to figure out number three when I get more experience. I got it to work by just creating my own commands and starting the repl with Kitty (although I may switch to tmux).

1 Like

Hi Ben, kakoune helper links. The code explains it better than I can.

Cool, bye :wave:
Sorry forgot to say Welcome Ben!

tmux-repl is a copy and paste function see the Summary picture below. Kak on the left and tmux-repl on the right, with the use of kak’s :send-text command to do the copy and paste.