blob: a86de7b711393d6f8aab2f330a6f65baa8273b67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# osc52
A command line tool to access the system clipboard from anywhere on the command line using the [ANSI OSC52](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands) sequence.
System clipboard access includes writing (i.e. copy) and reading (i.e. paste), even while logged into a remote machine via ssh.
## Usage
```
Reads or writes the system clipboard using the ANSI OSC52 escape sequence.
Usage:
COPY mode (default):
osc52 [file1 [...fileN]]
With no arguments, will read from stdin.
PASTE mode:
osc52 --paste
Outputs clipboard contents to stdout.
Options:
-logFile string
redirect logs to file
-paste
paste operation
-v verbose logging
-verbose
verbose logging
```
## Compatibility
OSC52 is overall [widely supported](https://github.com/ojroques/vim-oscyank/blob/main/README.md#vim-oscyank), but clipboard read operation is less widely supported than write.
#### Terminal Multiplexer support
`tmux` and `screen` have not been tested yet and probably do not work. Support is planned in the future.
## Installation
#### go 1.16 or later:
```
go install -v github.com/theimpostor/osc52@latest
```
#### go 1.15 or earlier:
```
GO111MODULE=on go get github.com/theimpostor/osc52@latest
```
This will install the latest version of osc52 to `$GOPATH/bin`. To find out where `$GOPATH` is, run `go env GOPATH`
## Credits
Credit and thanks to the the [vim-ocsyank](https://github.com/ojroques/vim-oscyank) plugin
|