{"id":16096469,"url":"https://github.com/aymanbagabas/shcopy","last_synced_at":"2025-04-09T13:06:46.281Z","repository":{"id":61326008,"uuid":"550437790","full_name":"aymanbagabas/shcopy","owner":"aymanbagabas","description":"📋 Copy text to your system clipboard locally and remotely using ANSI OSC52 sequence","archived":false,"fork":false,"pushed_at":"2025-01-30T00:13:18.000Z","size":48,"stargazers_count":76,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T12:09:24.912Z","etag":null,"topics":["shell","ssh","telnet","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aymanbagabas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["aymanbagabas"],"patreon":"aymanbagabas","custom":["https://www.paypal.me/aymanbagabas","https://www.buymeacoffee.com/aymanbagabas"]}},"created_at":"2022-10-12T19:10:38.000Z","updated_at":"2025-03-17T15:00:25.000Z","dependencies_parsed_at":"2024-01-07T21:02:21.450Z","dependency_job_id":"3d52bf22-2e2d-464d-9716-a7727f252982","html_url":"https://github.com/aymanbagabas/shcopy","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":"0.24444444444444446","last_synced_commit":"8290b0472e6ed63d301ec39ccee7c3e635e8eb05"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanbagabas%2Fshcopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanbagabas%2Fshcopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanbagabas%2Fshcopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanbagabas%2Fshcopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aymanbagabas","download_url":"https://codeload.github.com/aymanbagabas/shcopy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045231,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shell","ssh","telnet","terminal"],"created_at":"2024-10-09T17:14:02.476Z","updated_at":"2025-04-09T13:06:46.255Z","avatar_url":"https://github.com/aymanbagabas.png","language":"Go","funding_links":["https://github.com/sponsors/aymanbagabas","https://patreon.com/aymanbagabas","https://www.paypal.me/aymanbagabas","https://www.buymeacoffee.com/aymanbagabas"],"categories":["\u003ca name=\"copy-paste\"\u003e\u003c/a\u003eCopy/paste and clipboard"],"sub_categories":[],"readme":"# shcopy\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/aymanbagabas/shcopy/actions\"\u003e\u003cimg src=\"https://github.com/aymanbagabas/shcopy/workflows/build/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/aymanbagabas/shcopy/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/aymanbagabas/shcopy.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**Sh**ell **Copy** is a simple utility that copies text to the clipboard from anywhere using [ANSI OSC52](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands) sequence. It works with local terminals (/dev/tty\\*) and remote terminals (SSH, Telnet).\n\nThink of this as a tool like `xclip` or `pbcopy` but also works over SSH.\n\n## Example\n\n```sh\n# Copy text to clipboard\nshcopy \"Hello World\"\n\n# Copy text to primary clipboard (X11)\nshcopy -p \"Hello World\"\n\n# Copy command output to clipboard\necho -n \"Hello World\" | shcopy\n\n# Copy file content to clipboard\nshcopy \u003c file.txt\n\n# Copy from stdin until EOF\n# Ctrl+D to finish\nshcopy\n\n# Need help?\nshcopy --help\n```\n\n## Installation\n\n### Go Install\n\n```sh\ngo install github.com/aymanbagabas/shcopy@latest\n```\n\n### Homebrew\n\n```sh\nbrew install aymanbagabas/tap/shcopy\n```\n\n### Debian/Ubuntu\n\n```sh\necho 'deb [trusted=yes] https://repo.aymanbagabas.com/apt/ /' | sudo tee /etc/apt/sources.list.d/aymanbagabas.list\nsudo apt update \u0026\u0026 sudo apt install shcopy\n```\n\n### Fedora\n\n```sh\necho '[aymanbagabas]\nname=Ayman Bagabas\nbaseurl=https://repo.aymanbagabas.com/yum/\nenabled=1\ngpgcheck=0' | sudo tee /etc/yum.repos.d/aymanbagabas.repo\nsudo yum install shcopy\n```\n\n### Arch Linux\n\n```sh\nyay -S shcopy-bin\n```\n\n### Nix NUR\n\n```\nnix-shell -p nur.repos.aymanbagabas.shcopy\n```\n\n### Scoop (Windows)\n\n```sh\nscoop bucket add aymanbagabas https://github.com/aymanbagabas/scoop-bucket.git\nscoop install aymanbagabas/shcopy\n```\n\nYou can also download the latest binaries and packages from the [releases page](https://github.com/aymanbagabas/shcopy/releases).\n\n## Supported Terminals\n\nThis is a non-exhaustive list of the status of popular terminal emulators regarding OSC52 [^1]:\n\n| Terminal                                                                                  |                                                          OSC52 support                                                           |\n| ----------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------: |\n| [Alacritty](https://github.com/alacritty/alacritty)                                       |                                                             **yes**                                                              |\n| [foot](https://codeberg.org/dnkl/foot)                                                    |                                                             **yes**                                                              |\n| [GNOME Terminal](https://github.com/GNOME/gnome-terminal) (and other VTE-based terminals) |                                   [not yet](https://bugzilla.gnome.org/show_bug.cgi?id=795774)                                   |\n| [hterm (Chromebook)](https://chromium.googlesource.com/apps/libapps/+/master/README.md)   | [**yes**](https://chromium.googlesource.com/apps/libapps/+/master/nassh/doc/FAQ.md#Is-OSC-52-aka-clipboard-operations_supported) |\n| [iTerm2](https://iterm2.com/)                                                             |                                                             **yes**                                                              |\n| [kitty](https://github.com/kovidgoyal/kitty)                                              |                                                             **yes**                                                              |\n| [Konsole](https://konsole.kde.org/)                                                       |                                      [not yet](https://bugs.kde.org/show_bug.cgi?id=372116)                                      |\n| [QTerminal](https://github.com/lxqt/qterminal#readme)                                     |                                     [not yet](https://github.com/lxqt/qterminal/issues/839)                                      |\n| [screen](https://www.gnu.org/software/screen/)                                            |                                                             **yes**                                                              |\n| [st](https://st.suckless.org/)                                                            | **yes** (but needs to be enabled, see [here](https://git.suckless.org/st/commit/a2a704492b9f4d2408d180f7aeeacf4c789a1d67.html))  |\n| [Terminal.app](\u003chttps://en.wikipedia.org/wiki/Terminal_(macOS)\u003e)                          |                                  no, but see [workaround](https://github.com/roy2220/osc52pty)                                   |\n| [tmux](https://github.com/tmux/tmux)                                                      |                                                             **yes**                                                              |\n| [Windows Terminal](https://github.com/microsoft/terminal)                                 |                                                             **yes**                                                              |\n| [rxvt](http://rxvt.sourceforge.net/)                                                      |                                                    **yes** (to be confirmed)                                                     |\n| [urxvt](http://software.schmorp.de/pkg/rxvt-unicode.html)                                 |                      **yes** (with a script, see [here](https://github.com/ojroques/vim-oscyank/issues/4))                       |\n| [xterm.js](https://xtermjs.org/) (Hyper terminal)                                         |                                    [not yet](https://github.com/xtermjs/xterm.js/issues/3260)                                    |\n| [wezterm](https://github.com/wez/wezterm)                                                 |                [**yes**](https://wezfurlong.org/wezterm/escape-sequences.html#operating-system-command-sequences)                |\n\n[^1]: Originally copied from [vim-oscyank](https://github.com/ojroques/vim-oscyank)\n\n### Tmux\n\nTo use shcopy within a tmux session, make sure that the outer terminal supports\nOSC 52, and use one of the following options:\n\n1. Configure tmux to allow programs to access the clipboard (recommended). The\n   tmux `set-clipboard` option was added in tmux 1.5 with a default of `on`;\n   the default was changed to `external` when `external` was added in tmux 2.6.\n   Setting `set-clipboard` to `on` allows external programs in tmux to access\n   the clipboard. To enable this option, add `set -s set-clipboard on` to your\n   tmux config.\n\n2. Use `--term tmux` option to force shcopy to work with tmux. This option\n   requires the `allow-passthrough` option to be enabled in tmux. Starting with\n   tmux 3.3a, the `allow-passthrough` option is no longer enabled by default.\n   This option allows tmux to pass an ANSI escape sequence to the outer\n   terminal by wrapping it in another special tmux escape sequence. This means\n   the `--term tmux` option won't work unless you're running an older version\n   of tmux or you have enabled `allow-passthrough` in tmux. Add the following\n   to your tmux config to enable passthrough `set -g allow-passthrough on`.\n\nRefer to https://github.com/tmux/tmux/wiki/Clipboard for more info.\n\n## Credits\n\nThis project is built on top of [go-osc52](https://github.com/aymanbagabas/go-osc52), based on [vim-oscyank](https://github.com/ojroques/vim-oscyank).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faymanbagabas%2Fshcopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faymanbagabas%2Fshcopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faymanbagabas%2Fshcopy/lists"}