Giter VIP home page Giter VIP logo

osc's Introduction

osc

A command line tool to access the system clipboard from anywhere using the ANSI OSC52 sequence.

System clipboard access includes writing (i.e. copy) and reading (i.e. paste), even while logged into a remote machine via ssh.

Examples

❯ echo asdf | osc copy

# String 'asdf' copied to clipboard

❯ osc paste
asdf

Usage

Reads or writes the system clipboard using the ANSI OSC52 escape sequence.

Usage:
  osc [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  copy        Copies input to the system clipboard
  help        Help about any command
  paste       Outputs system clipboard contents to stdout
  version     Outputs version information

Flags:
  -d, --device string   select device
  -h, --help         help for osc
  -l, --log string   write logs to file
  -v, --verbose      verbose logging

Use "osc [command] --help" for more information about a command.

Compatibility

OSC52 is overall widely supported, but clipboard read operation is less widely supported than write.

Terminal Terminal OS Shell OS Copy Paste Notes
alacritty 0.12.2 macOS linux
alacritty 0.12.2 macOS macOS
alacritty 0.12.1 Windows linux
kitty 0.29.0 macOS linux Prompts for access
kitty 0.29.0 macOS macOS Prompts for access
windows terminal v1.17.11461.0 Windows linux
iterm2 macOS linux Paste requires version 3.5.0 (currently beta). Prompts for access.
iterm2 macOS macOS Paste requires version 3.5.0 (currently beta). Prompts for access.
hterm ChromeOS linux

Terminal Multiplexer support

Using alacritty as the terminal, default configuration options for multiplexer:

Terminal Multiplexer Copy Paste Notes
screen 4.09.00
zellij 0.37.2
tmux 3.2a May require configuration

Installation

go install -v github.com/theimpostor/osc@latest

This will install the latest version of osc to $GOPATH/bin. To find out where $GOPATH is, run go env GOPATH

TODO

  • [copy] check is stdin is readable
  • tmux support

For neovim

  • set init.lua
vim.cmd([[
let g:clipboard = {
  \   'name': 'osc-copy',
  \   'copy': {
  \      '+': 'osc copy',
  \      '*': 'osc copy',
  \    },
  \   'paste': {
  \      '+': 'osc paste',
  \      '*': 'osc paste',
  \   },
  \   'cache_enabled': 0,
  \ }
]])

Credits

osc's People

Contributors

theimpostor avatar pi12138 avatar

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.