Skip to content
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

doesn't work with sudo nvim #47

Open
kaymmm opened this issue Dec 4, 2023 · 1 comment
Open

doesn't work with sudo nvim #47

kaymmm opened this issue Dec 4, 2023 · 1 comment

Comments

@kaymmm
Copy link

kaymmm commented Dec 4, 2023

The kitty.conf keybindings don't work when invoked with sudo. The pass_keys.py script captures "sudo" as the first executed command rather than nvim (the second command).

One partial solution to this is to change lines 9 of pass_keys.py to:

    return any(re.search(vim_id, p['cmdline'][p['cmdline'][0] == 'sudo'] if len(p['cmdline']) else '', re.I) for p in fp)

However, I can't figure out why this doesn't allow switching from the sudo nvim kitty window to the next adjacent kitty window. It works fine with non-sudo nvim windows.

Any help would be greatly appreciated!

@critterjohnson
Copy link

I believe sudo processes have their own session and environment that kitty does not touch. In other words, kitty can't even see processes run in sudo. I was not able to reproduce your workaround for this reason. However if sudo nvim is showing up in your logs, then you should be able to put

map ctrl+j kitten pass_keys.py bottom ctrl+j "(sudo )?n?vim"
map ctrl+k kitten pass_keys.py top    ctrl+k "(sudo )?n?vim"
map ctrl+h kitten pass_keys.py left   ctrl+h "(sudo )?n?vim"
map ctrl+l kitten pass_keys.py right  ctrl+l "(sudo )?n?vim"
allow_remote_control yes
listen_on unix:/tmp/mykitty

in your ~/.config/kitty/kitty.conf (change that last line if you're on linux; see the README).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants