While server -> client communication is well documented, and easy to pick with kak -ui json and thanks to the great wiki article by @Delapouite .
But I wonder how can I make kakoune listen to my own server, and send “draw” as input to a kakoune client.
An example if the above is mot clear enought:
Creating a python script that open a socket “mypyserver” that send json RPC . Stuff like:
The JSON-RPC interface is not actually the communication between the Kakoune client and server. When you run kak -ui json, that is a Kakoune client, talking to a server somewhere else. The actual client-server protocol is not documented anywhere, but is implemented in src/remote.cc. If you take a look, the protocol actually resembles the JSON-RPC interface, but it’s using a custom binary protocol. If you look in that file for the connect_to function, and the things it calls, and the things that call it, you should get a good idea how the protocol works.
But, basically, yes - if you listen on the right socket, and send and interpret the right protocol, Kakoune clients should be able to connect and you can make them display whatever.
I tried to listen to the socket file in my XDG_RUNTIME_DIR with nc -U /run/user/1000/kakoune/1234
who didn’t show anything and socat -d -d -d -d - UNIX-CONNECT:/run/user/1000/kakoune/1234 who was very cryptic.
I don’t think I have the right method to listen to RPC communication. I’ll have to dig into it a bit more. but thanks for the pointer.
Thanks for calling my out on that buddy!! I was laughing for a while on that one yesterday. Today I thought of my smart-ass come back…get ready to smile.
“Oh your looking for The answer, sorry we only do pieces to the puzzle on plant earth”
flame war flame war flame war
When pencil hits paper for the server solution/problem can you post your findings or link your repo, I’m interested in the outcome. Thanks bye