wincent / vim-clipper

Clipper integration for Vim
BSD 2-Clause "Simplified" License
43 stars 5 forks source link

feat: attempt to autodetect need for -N switch to nc #3

Closed wincent closed 4 years ago

wincent commented 4 years ago

Based on discussion here:

https://github.com/wincent/vim-clipper/issues/2

wincent commented 4 years ago

Can you test this out and see if it works for you @xiruizhao?

I'm not a fan of the complexity here, but we have a choice:

  1. Do nothing (ie. leave code as it was before; maybe try to improve the docs).
  2. Do what this PR does (ie. "sniff" output of nc -h to try and figure out whether to pass the -N switch); I don't have a Ubuntu-ish machine to test this on, so I don't even know if it works.
  3. Maintain a list of operating systems and check against that with uname; not a fan of that approach because people can install different tools irrespective of their OS, and the check could become quite unwieldy (for example, checking for "Linux" won't cut it because some distros — eg. Amazon Linux, which I was able to test — don't require or support -N).
xiruizhao commented 4 years ago

Works on Ubuntu. I think this PR is the best solution. You can also update the README of clipper to warn people (so that they can take care of their .bashrc).

wincent commented 4 years ago

Thanks for testing it @xiruizhao. Will give it a shot (merged).

wincent commented 4 years ago

Doc updates here: https://github.com/wincent/clipper/commit/451bac8101da33d755a6baaa97206eea50c82ca0