vim-slime icon indicating copy to clipboard operation
vim-slime copied to clipboard

Inaccurate documentation on kitty

Open newptcai opened this issue 3 years ago • 7 comments

The ReadMe says

To work properly, kitty must also be started with the following options:

kitty -o allow_remote_control=yes --listen-on unix:/tmp/mykitty

See more here. This can also be added to your kitty.conf file as:

allow_remote_control yes
listen_on unix:/tmp/mykitty

This is inaccurate. Putting listen_on unix:/tmp/mykitty will make each kitty instance listen to unix:/tmp/mykitty{kitty_pid}, where {kitty_pid} is the PID of the kitty process.

So to make slime work, you have to launch kitty from command line, or to use the method.

newptcai avatar Oct 19 '22 00:10 newptcai

Hi @newptcai

I don't use kitty myself, so I don't know if this changed. 🤔

Would you be willing to open a documentation PR for this?

cc @mdzhang @xiangpeng2008

jpalardy avatar Oct 19 '22 02:10 jpalardy

can confirm i can use vim + kitty + slime w/o listen_on unix:/tmp/mykitty

kitty 0.26.3 macos 12.6 monterey vim 9.0.0700

mdzhang avatar Oct 19 '22 13:10 mdzhang

can confirm i can use vim + kitty + slime w/o listen_on unix:/tmp/mykitty

kitty 0.26.3 macos 12.6 monterey vim 9.0.0700

If you run kitty and vim in the same os_window, then the environment variable KITTY_LISTEN_ON will be set correctly. You just need to provide the correct window ID.

newptcai avatar Oct 19 '22 14:10 newptcai

Hi there,

This has been opened for a few weeks ^

Can someone open a PR with their recommended/udpated kitty config?

jpalardy avatar Nov 02 '22 04:11 jpalardy

I think I explained things reasonably clear in Readme in my PR.

newptcai avatar Nov 02 '22 05:11 newptcai

The ReadMe says

To work properly, kitty must also be started with the following options:

kitty -o allow_remote_control=yes --listen-on unix:/tmp/mykitty

See more here. This can also be added to your kitty.conf file as:

allow_remote_control yes
listen_on unix:/tmp/mykitty

This is inaccurate. Putting listen_on unix:/tmp/mykitty will make each kitty instance listen to unix:/tmp/mykitty{kitty_pid}, where {kitty_pid} is the PID of the kitty process.

So to make slime work, you have to launch kitty from command line, or to use the method.

You can actually make it work quite easily with a few lines in your .vimrc/init.lua. I currently have the following lines in my init.lua file that assigns the correct default value for vim-slime by extracting the pid of kitty process. However, this breaks if one has multiple kitty instances running at the same time.

-- NOTE: Assumes that kitty.conf has parameter 
-- 'listen_on' set to unix:/tmp/mykitty
-- In this case, kitty will append the pid of kitty to the end of the path
-- Thus we check the pid of the kitty instance, and use that as the 
--
local pid = vim.fn.system("pgrep kitty")
pid = pid:gsub("[\n\r]","") 
local listen_on = string.format("unix:/tmp/mykitty-%s", pid)
vim.g.slime_default_config = {['listen_on']=listen_on, ['window_id']=2}

SanteriHei avatar Nov 20 '22 14:11 SanteriHei

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 21 '23 20:05 stale[bot]