• Stars
    star
    214
  • Rank 184,678 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

remote pbcopy for iTerm2

remote pbcopy for iTerm2

pbcopy is a well-known macOS tool that copies data to the clipboard. It's very useful, but available only in your local machine, not in remote machines.

Fortunately, with OSC52 escape sequence, we can access the local machine clipboard via a remote machine.

I prepared a simple tool that is pbcopy for remote machines.

Install

  1. First, make sure you use iTerm2 version 3.0.0 or later.

  2. Copy a preferred pbcopy to a directory where $PATH is set.

    [local]  $ ssh remote
    
    # If you prefer a self-contained binary, then
    [remote] $ curl -fsSLo pbcopy-linux-amd64.tar.gz https://github.com/skaji/remote-pbcopy-iterm2/releases/latest/download/pbcopy-linux-amd64.tar.gz
    [remote] $ tar xf pbcopy-linux-amd64.tar.gz
    [remote] $ mv pbcopy /path/to/bin/
    
    # If you prefer a perl script, then
    [remote] $ curl -fsSLo pbcopy https://raw.githubusercontent.com/skaji/remote-pbcopy-iterm2/master/pbcopy
    [remote] $ chmod +x pbcopy
    [remote] $ mv pbcopy /path/to/bin/
    
    # If you prefer a python script, then
    [remote] $ curl -fsSLo pbcopy https://raw.githubusercontent.com/skaji/remote-pbcopy-iterm2/master/pbcopy.py
    [remote] $ chmod +x pbcopy
    [remote] $ mv pbcopy /path/to/bin/
    
  3. Check "Applications in terminal may access clipboard" in iTerm2 Preferences:

    preferences.png

Usage

Just like the normal pbcopy:

[local]  $ ssh remote
[remote] $ date | pbcopy
[remote] $ exit
[local]  $ pbpaste
Sun Jan 18 20:28:03 JST 2015

How about pbpaste?

Currently iTerm2 does not allow OSC 52 read access for security reasons. But we can just use command+V key to paste content from clipboard.

If you want to save the content of clipboard to a remote file, try this:

[remote] cat > out.txt
# press command+V to paste content of clipboard,
# and press control+D which indicats EOF

See also

For OSC52

Author

Shoichi Kaji

License

MIT

More Repositories

1

relocatable-perl

self-contained, portable perl binaries
Perl
57
star
2

mi6

minimal authoring tool for Raku
Raku
54
star
3

perl-github-actions-sample

Perl meets GitHub Actions
Perl
31
star
4

Frinfon

minimal sinatra for perl6
Perl 6
17
star
5

perl-tldr

a perl client for https://tldr.sh/
Perl
15
star
6

syntax-check-perl

Perl
15
star
7

perl-install

Build and install perls
Shell
14
star
8

rakuenv

Raku Environment Manager
Shell
13
star
9

App-RemoteCommand

simple remote command launcher via ssh
Perl
12
star
10

App-FatPacker-Simple

Perl
11
star
11

raku-HTTP-Tinyish

Raku
8
star
12

Parallel-Pipes

https://metacpan.org/release/Parallel-Pipes
Perl
8
star
13

Carl

Perl
7
star
14

plenv-download

download precompiled perl binaries
Shell
6
star
15

relocatable-perl-growthforecast

Shell
5
star
16

docker-gitlab

Shell
4
star
17

perl6-tips

Perl 6
4
star
18

docker-monit

Shell
4
star
19

Mojo-SlackRTM

Perl
4
star
20

Perl-PrereqDistributionGatherer

Perl
4
star
21

perl6-build

Perl
4
star
22

CPAN-Mirror-Tiny

Perl
4
star
23

perl-dockerfile-sample

Dockerfile
3
star
24

cpan-dependency-file-converter

Perl
3
star
25

perl6-tail

Perl 6
3
star
26

change-shebang

change shebang lines for relocatable perl
Perl
3
star
27

c-minimal-logger

C
2
star
28

Devel-PatchPerl-Plugin-FixCompoundTokenSplitByMacro

Perl
2
star
29

Test2-Formatter-CompactTimer

Perl
2
star
30

perl6-WaitGroup

golang's sys.WaitGroup in perl6
Perl 6
2
star
31

raku-Acme-Test-Module-Zef

Raku
2
star
32

cpm-resolver-sample

Perl
2
star
33

Dist-Zilla-Plugin-Prereqs-From-cpmfile

Perl
2
star
34

slack-perl6-evalbot

Perl
2
star
35

CPAN-02Packages-Search

Perl
2
star
36

perl6-librarymake-example

Perl 6
2
star
37

patchperl-extracted

Collection of patch files for old perls
Roff
2
star
38

docker-mod_perl

https://cloud.docker.com/u/skaji/repository/docker/skaji/mod_perl
Dockerfile
2
star
39

cpan-zero

Perl
2
star
40

cpmfile

Perl
1
star
41

CPAN-Flatten

Perl
1
star
42

JSON-RPC-Lite

Perl
1
star
43

Crust-issue

Perl 6
1
star
44

Library-Build

Perl
1
star
45

raku-macos-openssl

Raku
1
star
46

Data-Section-Simple

Perl 6
1
star
47

appveyor-test

Perl
1
star
48

xs-with-module-build

How to develop xs module with Module::Build / Minilla
C++
1
star
49

build.pl

build perls for plenv
Perl
1
star
50

nginx-unit-example-perl

Shell
1
star
51

Process-Pipeline

Perl
1
star
52

perl-xs-dist-zilla

Perl
1
star
53

perl-hang

Perl
1
star
54

go-github-release

Go
1
star
55

binary-install

Perl
1
star
56

perl-releases

Perl
1
star
57

CSS-clessc

a perl binding for https://github.com/BramvdKroef/clessc
C++
1
star
58

mi

Perl
1
star
59

Test-CI

Get details about the current CI environment
Perl
1
star
60

raku-CPAN-Uploader-Tiny

Raku
1
star
61

1password-otp

Go
1
star
62

Acme-LatestPerl

Perl
1
star
63

PAUSE-Permissions-MetaCPAN

Perl
1
star
64

d3-box-plot

CoffeeScript
1
star
65

display-http-headers

Google Chrome App
JavaScript
1
star
66

plenv-v

Perl
1
star
67

perl-static-install

Perl
1
star
68

Pod-Perl6doc

perldoc for Perl6
Perl 6
1
star
69

Alien-Libasyncns

Perl
1
star
70

Minilla-CLI-Add

minil add command
Perl
1
star
71

App-Write-Index

Perl
1
star
72

GnawHosts

A Google Chrome App
JavaScript
1
star
73

perl-scaffold

Perl
1
star
74

Devel-PatchPerl-Plugin-Darwin-getcwd

Perl
1
star
75

CPAN-Test-Dummy-Perl5-ModuleBuild

Perl
1
star
76

pxe-boot

JavaScript
1
star
77

plenv-plugin-install

Perl
1
star
78

p6env-reset

Perl
1
star
79

perl-github-release

Perl
1
star
80

perl-D

Perl
1
star