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

Unable to Navigate when Running sudo vim #426

Open
andreasacwu opened this issue Jan 17, 2025 · 2 comments
Open

Unable to Navigate when Running sudo vim #426

andreasacwu opened this issue Jan 17, 2025 · 2 comments

Comments

@andreasacwu
Copy link

When using vim-tmux-navigator with sudo vim, navigation does not function as expected. It seems that tmux recognizes sudo as the active process instead of vim, causing navigation keybindings to fail.

Steps to Reproduce

  1. Split tmux window into 2 panes with <prefix> %
  2. Run sudo vim in the right pane
  3. Inside Vim, split the window into two with :vsplit
  4. Attempt to navigate to the left Vim split using <C-h>
    The navigation keys incorrectly switch focus to the other tmux pane instead of staying within Vim.
@andreasacwu andreasacwu changed the title Unable to Navigate when Running sudo vim Unable to Navigate when Running sudo vim Jan 17, 2025
@christoomey
Copy link
Owner

Hmm, it seems like running in sudo changes some things about how vim behaves. You can try the notes in the troubleshooting guide, but I wouldn't be surprised if this plugin is incompatible with running via sudo.

@BriHan-Tech
Copy link

@christoomey @andreasacwu It seems like the is-vim issue is affecting many people, and I will do a PR on adding this script to the code.

I believe the issue is caused by the fact that the is_vim check doesn't check for nested processes and only checks for the current process.

Here is my detailed solution to the problem:

https://github.com/BriHan-Tech/is-vim

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

3 participants