#clipboard #terminal


a minimal cross-platform clipboard

7 unstable releases

0.4.0 Mar 23, 2023
0.3.1 Nov 6, 2021
0.3.0 Oct 26, 2021
0.2.1 Feb 26, 2021
0.1.1 Sep 8, 2020

#419 in Rust patterns

Download history 162/week @ 2023-02-06 135/week @ 2023-02-13 174/week @ 2023-02-20 142/week @ 2023-02-27 120/week @ 2023-03-06 227/week @ 2023-03-13 418/week @ 2023-03-20 223/week @ 2023-03-27 153/week @ 2023-04-03 138/week @ 2023-04-10 115/week @ 2023-04-17 168/week @ 2023-04-24 199/week @ 2023-05-01 151/week @ 2023-05-08 168/week @ 2023-05-15 192/week @ 2023-05-22

769 downloads per month
Used in 7 crates

MIT license

310 lines


CI MIT Latest Version Chat on Miaou

terminal-clipboard is a cross-platform clipboard library focused on strings copying and pasting for terminal applications:

  • it's tested on linux, windows and Android (Termux)
  • it doesn't handle other types of objects than strings
  • it doesn't handle non UTF8 strings


assert_eq!("test", terminal_clipboard::get_string().unwrap());

Supported platforms

The implementation is currently chosen from the "target_os" part of the compilation target.

Android (Termux)

The current implementation will defer to Termux API facilities to access the Android clipboard, and won't work if the Termux API isn't available at runtime.

If you know of solutions to access the Android clipboard without Termux, please open an issue.


If a unix-like target is detected and the "termux" feature isn't enabled, terminal-clipboard uses the x11-clipboard crate.

You'll need to have xorg-dev and libxcb-composite0-dev to compile.

On Debian and Ubuntu you can install them with

sudo apt install xorg-dev libxcb-composite0-dev


If the compilation target is "windows", terminal-clipboard uses the clipboard-win crate. If you're only interested in this platform, you should use this crate directly.