wincent / clipper Goto Github PK
View Code? Open in Web Editor NEW✂️ Clipboard access for local and remote tmux sessions
License: BSD 2-Clause "Simplified" License
✂️ Clipboard access for local and remote tmux sessions
License: BSD 2-Clause "Simplified" License
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
I've been looking for this for a long time. This is a life saver. Thank you for your hard work
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.
use nc -q 1
nnoremap y :call system('nc -q 1 host.docker.internal 8377', @0)
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?
Example:
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
.
Hey guys,
I don't use your project, but came across your commit here: ae2800d
Based on the comments in this commit, I'm lead to believe that the intent is to only listen on the loopback address(es) when only the port is specified.
If that is the intent, then that code is broken. If not, then ignore me. :)
Here's the relevant net.Listen() example from the golang docs: https://golang.org/pkg/net/#example_Listener
Happy trails!
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 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
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.
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?)
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?
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
If there is an IPv6 loopback interface available, we should listen on that too (::1) as well as on the IPv4 one (127.0.0.1).
If the user explicitly passes an address (or a UNIX domain socket) then we should listen only to the user-specified address.
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!
When running clipper via brew services start clipper
, I don't see a way to configure it to use a unix socket (for use in docker mount). How can this be done in a sustainable way?
Hi! I just found clipper. But I think lemonade is better - https://github.com/pocke/lemonade
It's cross platform, works in both sides. What for I need clipper?
Oh, maybe clipper has nice logo. That's a big point.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.