-
Notifications
You must be signed in to change notification settings - Fork 322
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
Vim -> Vim not working in MSYS2 and Cygwin #246
Comments
Here's the extended is_vim line with the regex to cover the variants of the vim name as per the original:
|
Hey @pnetherwood, thanks for the detailed notes and the suggestion. I'm generally very conservative with changes to the core vim matching logic, but this seems straightforward enough and should improve portability, so I think it sounds like a worthwhile change. Would you mind turning this into a PR, updating the reference to the snippet in both the README and the tmux plugin manager version? |
Hmm, so I'm running with this update locally and it doesn't seem to work, specifically the Vim detection portion. I'm running |
What platform are you on? Does the output of ps -a include the tty? Since there is no -t for the ps command on MSYS2 I just add the pane tty to the grep but strip out the /dev/ part using tmux variable substitution. Try this in a shell inside tmux to test:
You should see a tty name that should in the the ps -a list. We can grep out the current pane's tty from the list using.
The grep pattern is then extended to have the second part of the original grep.
(Note I've escaped the # so it can run from vim). This is what I used to debug it but I've only tried it in MSYS2 and on Ubuntu. |
I've figured out the issue with this. It relies on tmux substitution format which needs to be in this form:
on tmux 3 you get the tty without the /dev/. On other earlier versions you get no output. You could point people to this PR if they are trying to get it to work on MSYS2. |
The tmux plugin doesn't work for systems like MSYS2 and Cygwin because the ps command is much simpler and hasn't got the format options required for the Tmux plug in.
The original line:
fails in MSYS2 and Cygwin because the native ps command does no support -o or -t.
I have fixed it with the following line:
which works on both MSYS2 and on my Ubuntu systems. The command relies on the tmux variable substitution to remove the /dev/ from the pane tty name and then greps for a tty name and vim from the ps output. It doesn't do the same process state filtering that the original does but that info is not available in the MSYS2 and Cygwin ps command.
It might be worth considering if this is a more generic cross platform solution.
The text was updated successfully, but these errors were encountered: