Skip to main content

Utilities to access the clipboard via OSC52

Project description


oscclip is a little, zero dependency python utility which utilizes the system clipboard via OSC52 escape sequences. Using these sequences, the system clipboard is accessible via SSH as well. Terminal multiplexers, such as tmux and screen are supported.


Setting the clipboard

$ echo "Foo" | osc-copy

Setting the clipboard and bypass terminal multiplexers

$ echo "Foo" | osc-copy --bypass

Reading the clipboard

$ osc-paste

Tested Terminals



Currently there is a bug in tmux. Due to this osc-paste does currently not work with tmux running in foot. The bug is fixed in upstream tmux but not yet released.


Arch Linux

$ paru -S oscclip

Run via poetry

Check if your distribution provides poetry via its package management system! It might be called python-poetry, python3-poetry or similar!


$ poetry install [--no-dev]
$ poetry run ocs-copy

--no-dev omits the development dependencies, such as static code checkers.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oscclip-0.4.0.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

oscclip-0.4.0-py3-none-any.whl (15.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page