#clipboard #text #ssh #session #wsl #power-shell #osc

bin+lib clipboard-anywhere

Copy text to the clipboard, even in WSL and SSH sessions

6 releases

0.2.3 Dec 24, 2023
0.2.2 Sep 22, 2023
0.2.1 Aug 1, 2022
0.1.1 Jul 28, 2022

#27 in #wsl

Download history 16/week @ 2025-12-25 4/week @ 2026-01-01 62/week @ 2026-01-08 41/week @ 2026-01-15 30/week @ 2026-01-22 91/week @ 2026-01-29 22/week @ 2026-02-05 37/week @ 2026-02-12 28/week @ 2026-02-19 9/week @ 2026-02-26 63/week @ 2026-03-05 27/week @ 2026-03-12 49/week @ 2026-03-19 33/week @ 2026-03-26 53/week @ 2026-04-02 53/week @ 2026-04-09

192 downloads per month
Used in 4 crates

MIT license

6KB
66 lines

clipboard-anywhere

Crates.io

A simple wrapper around arboard that works in a few more situations:

  • In Linux under WSL, it can copy to and from the Windows clipboard (using powershell set-clipboard and powershell get-clipboard)
  • In a remote SSH session, can copy to the local clipboard using the OSC 52 control sequence

Usage

// Attempt to get clipboard contents. Will return error in an SSH session
let clipboard_contents: String = clipboard_anywhere::get_clipboard()?;

// Set clipboard contents to "Hello, world!";
clipboard_anywhere::set_clipboard("Hello, world!")?;

To Do

  • Define custom errors instead of passing everything through Anyhow
  • Write some integration tests

Dependencies

~0.7–17MB
~181K SLoC