-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thoughts on using in ssh? #42
Comments
Seems reasonable, but I don't know enough about kitty or the ssh kitten to offer any suggestions. I'd be more than happy to accept a pull request, though, if it's something you would like to work on. |
I’ve poked through the ssh sources and can’t find anything immediately applicable, but it feels like the plumbing is there to support it. Will try to do a deeper dive if I can find the time. |
See discussion here which should give you some help: kovidgoyal/kitty#6229 |
Tested a heavily customized (my titles use a lot of aliases...) variation on gzagatti's post and was able to get pass_keys.py to detect a vim window inside ssh. However, now neighbouring_window.py, when called from the vim session inside ssh, is not able to pass the command out to kitty outside ssh. Will try to debug further this weekend. |
I know what's happening. The problem is that now your keys are being passed to nvim. However when you issue the command from nvim, the command fails. Under the hood, nvim is trying to call
If your
The problem here is that nvim does not spawn commands connected to the tty. Check this discussion thread. So what can you do? One option is to reverse bind the kitty socket to the remote server:
Then set the env variable In that case, you might want to set Please let me know if you find a simpler setup. |
Also see issue mrjones2014/smart-splits.nvim#103. You'll likely want to use user var as kitty has recently introduced it. |
Just FYI, some recent additions to kitty to make this easier: The ssh kitten can now automatically forward the kitty remote control socket by setting forward_remote_control yes in ~/.config/kitty/ssh.conf And you dont need neighboring_window.py anymore, you can just do
Change left to right/top/bottom as needed. You will need to run from master/nightly for these till the next kitty release. |
That's great! I'll test once the new Kitty version comes out. |
Did you end up getting a working solution with the new kitty? I tried following along the various threads and discussions you were on but wasn't able to recreate something working myself 😔 |
No, at the end I just kept my setup above because it was working pretty well already. I also did not quite figure out how to use the new feature. |
It works partially for me. |
I've found a solution after considering the We can set a variable when nvim opens, and unset when it closes via auto-cmd. First set the user variable:return {
"knubie/vim-kitty-navigator",
build = "cp ./*.py ~/.config/kitty/",
config = function()
vim.fn.system("kitten @ set-user-vars IS_NVIM=true")
-- VimLeavePre event was also suggested by KovidGoyal
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function()
vim.fn.system("kitten @ set-user-vars IS_NVIM=false")
end,
})
end,
} Second, adjust
|
I often ssh into a system and run neovim inside the ssh terminal. As a result,
pass_keys.py
is unable to determine whether the ssh window is a vim window or not.I use
kitty + kitten ssh
to ssh into the target system. The foreground_process contains a long and complex ssh command. But since I used kitty`s ssh kitten, I'm wondering if it might be possible to ask it what process is running inside the ssh session and let the keys pass through in that case. Know of any way to support this?The text was updated successfully, but these errors were encountered: