Code Monkey home page Code Monkey logo

clipper's Issues

Clipper not working

I have installed clipper and vim-clipper via your dotfiles installer but I can't get it working. I have tried uninstalling clipper and reinstalling via homebrew, restarting clipper but it still does not seem to work. I am running clipper 0.4.1, OS X 10.12.2, vim v8.

I would appreciate it if you could suggest a way to get this working properly.

Regards

Paul

pbpaste

I would love to be able to use this as a pbpaste helper in addition to the pbcopy it already provides.

I know you recommend to just paste, and with bracketed paste mode this is mostly seamless, but unfortunately pasting through terminal seems to lose certain special characters (namely those represented as such: ^] ^\ ^B ^^)

Wondering what options we have, if any, to get this to support pbpaste in addition to pbcopy. I'm thinking a second netcat tunnel that whenever requested will call pbpaste on the machine running clipper and pipe the output through the netcat tunnel.

netcat hangs

I found that my version of netcat on Debian 10 (Buster) hangs.

I had to slap a -q 1 into the netcat command's like so:

nc -q 1 localhost 8377

I don't know enough about netcat to know if this is a smart change or not. But it seems to work. Perhaps this fix should be documented?

Usage on boxes that are both local and remote

Example:

  • Linux box as desktop: sometimes, I am physically using it, running Clipper out of systemd.
  • Same Linux box as remote server: sometimes, I ssh into it, and want stuff forwarded back to Clipper on my Mac.

In the latter scenario, I'm not even sure what happens. The systemd instance of Clipper is listening on the socket. I'm using kitty on the Mac. It seems to be doing some magic, because when I paste (Command-V) I end up getting everything I've copied into Clipper on that machine... Did I set this up at some point and forget about it? Doesn't happen in iTerm, and doesn't show up when I inspect Clipboard on the Mac. Additionally, I don't recall setting up reverse port-forwarding to the Linux box in my ~/.ssh/config.

Tmux 2.4 key binding commands changed

What previously was defined as:

bind-key -t vi-copy Enter copy-pipe "nc localhost 8377"

in tmux >= 2.4 now should be:

bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "nc localhost 8377"

UNIX domain socket - old:

bind-key -t vi-copy Enter copy-pipe "nc -U ~/.clipper.sock"

new:

bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "nc -U ~/.clipper.sock"

Clipper works when started manually, but not from unit file

Clipper works when I start it manually, but from if I start it with the example unit file and the same config, it gives me an error when I try to copy to it (via unix socket).

$ systemctl --user start clipper
clipper: 2018/08/08 21:05:39 Starting UNIX domain socket server at /home/sketch/.ssh/clipper.sock
clipper: 2018/08/08 21:09:03 [ERROR] pipe copy: write |1: broken pipe
clipper: 2018/08/08 21:09:03 [ERROR] wait: exit status 1
clipper: 2018/08/08 21:09:03 Connection closed
[sketch@laptop ~]$ systemctl --user stop clipper
clipper: 2018/08/08 21:09:35 Got signal terminated
clipper: 2018/08/08 21:09:35 accept unix /home/sketch/.ssh/clipper.sock: use of closed network connection
[sketch@laptop ~]$ clipper
clipper: 2018/08/08 21:09:41 Starting UNIX domain socket server at /home/sketch/.ssh/clipper.sock
clipper: 2018/08/08 21:09:43 Echoed 4 bytes
clipper: 2018/08/08 21:09:43 Connection closed

Document caveats with BSD netcat vs GNU netcat vs socat etc

nc has different implementations on different systems. Using gnu nc (which is installable by brew on any system) with the -c flag works best in my experience. This flag may not be present on other implementations or may not work correctly.

No error logs available when service is started with homebrew

I tried modifying sudo vim /opt/homebrew/Cellar/clipper/2.0.0/homebrew.mxcl.clipper.plist to tell clipper to use socket by default, but brew services showed an error when trying to start. There is nowhere to actually view that error.

(also, is this the correct way to configure clipper to use socket on MacOS?)

Empty options get reverted to default

Using Clipper with Windows Subsystem for Linux (Bash for Windows) requires an executable value of /mnt/c/Windows/System32/clip.exe and no flags.

WSL reports as Linux, and gets the default flag of -selection clipboard. When providing an empty flag -f via config or cli, the empty value gets reverted back to the default by https://github.com/wincent/clipper/blob/master/clipper.go#L188.

On my local version, Clipper works correctly in this environment when the else branch of that condition is removed. Is there a reason for normalizing empty options?

Handle all 3 Selections

xclip provides the following flag:

-f, -filter
when xclip is invoked in the in mode with output level set to silent (the defaults), the filter option will cause xclip to print the text piped to standard in back to standard out unmodified

It allows for users to do the following: ( Which I need since I run in VMWare Workstation sometimes )

xclip -sel p -f | xclip -sel sec -f | xclip -sel c

Netcat usage example for alternative versions

The version of netcat installed by Ubuntu 17.04's package archive (1.10-41) exhibits slightly different behavior than the version typically installed by Homebrew on macOS. nc localhost 8377 ends up causing an annoying block when sending bytes into Clipper. As a long time macOS user, I instantly noticed the difference.

Digging into the godoc for os.Copy reads

Copy copies from src to dst until either EOF is reached on src or an error occurs.

A slightly different usage of nc -N localhost 8377 exhibits the behavior I am used to. It would be helpful to have a mention in the documentation for others who may not be getting a very good user experience.

I'm a long-time fan of Clipper. Thanks for making such an awesome tool!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.