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

Fix errors on macOS for WSL detection #36

Merged
merged 4 commits into from
Sep 7, 2020

Conversation

hexcowboy
Copy link
Contributor

Relating to issues #33 and #35

The problem is solely that when detecting the OS, the file /proc/version is read. Darwin does not contain this file so it throws an error. It's better to nest the check for WSL in the s:os == "Linux" line.

The issue may still persist (#34) that an error will be thrown on WSL that don't contain the proc/version file. I don't have WSL to test.

This PR fixes the issue on macOS.

@hexcowboy
Copy link
Contributor Author

Also if anyone stumbles here because they're trying to fix this issue on WSL, try using grep to check for WSL. And modify the IsWSL function as necessary.

The vimscript would look like:

if execute "grep -q Microsoft /proc/version"
  return 1
endif

@ferrine
Copy link
Collaborator

ferrine commented Aug 28, 2020

I believe we need to fix both at once, so let's wait for folks with WSL

@keblek
Copy link

keblek commented Sep 2, 2020

I am on Neovim with macOS Cataline using this plugin and I get a flashing error where the plugin is looking for proc/version but then it goes away but the plugin seems to work.

Just to let you know.

@hexcowboy
Copy link
Contributor Author

I was able to test on WSL and the error is no longer occuring.

However, I did find a new bug that is unrelated but pertains to WSL. I will reference it in a new Issue.

@ferrine
Copy link
Collaborator

ferrine commented Sep 4, 2020

Should we merge?

@hexcowboy
Copy link
Contributor Author

Probably not.. wait for a fix for #38. I'll look into it this week to figure out what the WSL problem is.

@hexcowboy
Copy link
Contributor Author

hexcowboy commented Sep 7, 2020

Ready for merging now that #38 and #34 are resolved

@ferrine ferrine merged commit 8cd5539 into img-paste-devs:master Sep 7, 2020
@ferrine
Copy link
Collaborator

ferrine commented Sep 7, 2020

Merged 2 pull requests, is it working fine now?

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

Successfully merging this pull request may close these issues.

3 participants