{"id":13478905,"url":"https://github.com/tmux-plugins/tmux-yank","last_synced_at":"2025-10-06T22:28:22.708Z","repository":{"id":18093510,"uuid":"21159522","full_name":"tmux-plugins/tmux-yank","owner":"tmux-plugins","description":"Tmux plugin for copying to system clipboard. Works on OSX, Linux and Cygwin.","archived":false,"fork":false,"pushed_at":"2024-03-24T11:30:18.000Z","size":162,"stargazers_count":2825,"open_issues_count":47,"forks_count":124,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-13T23:53:43.296Z","etag":null,"topics":["clipboard","cygwin","linux","macos","shell","tmux","tpm","wsl"],"latest_commit_sha":null,"homepage":"https://tmux-plugins.github.io/tmux-yank/","language":"Shell","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/tmux-plugins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2014-06-24T09:37:12.000Z","updated_at":"2025-04-13T09:58:16.000Z","dependencies_parsed_at":"2024-01-07T11:11:45.949Z","dependency_job_id":"aba5d29b-d071-42e9-864a-fc76846d50fb","html_url":"https://github.com/tmux-plugins/tmux-yank","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmux-plugins%2Ftmux-yank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmux-plugins%2Ftmux-yank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmux-plugins%2Ftmux-yank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmux-plugins%2Ftmux-yank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmux-plugins","download_url":"https://codeload.github.com/tmux-plugins/tmux-yank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254042,"owners_count":22039792,"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":["clipboard","cygwin","linux","macos","shell","tmux","tpm","wsl"],"created_at":"2024-07-31T16:02:05.586Z","updated_at":"2025-10-06T22:28:17.689Z","avatar_url":"https://github.com/tmux-plugins.png","language":"Shell","readme":"[![Build\nStatus](https://travis-ci.org/tmux-plugins/tmux-yank.svg?branch=master)](https://travis-ci.org/tmux-plugins/tmux-yank)\n[![GitHub\nrelease](https://img.shields.io/github/release/tmux-plugins/tmux-yank.svg)](https://github.com/tmux-plugins/tmux-yank/releases)\n[![GitHub\nissues](https://img.shields.io/github/issues/tmux-plugins/tmux-yank.svg)](https://github.com/tmux-plugins/tmux-yank/issues)\n\ntmux-yank\n=========\n\nCopy to the system clipboard in [`tmux`](https://tmux.github.io/).\n\nSupports:\n\n-   Linux\n-   macOS\n-   Cygwin\n-   Windows Subsystem for Linux (WSL)\n\nInstalling\n----------\n\n### Via TPM (recommended)\n\nThe easiest way to install `tmux-yank` is via the [Tmux Plugin\nManager](https://github.com/tmux-plugins/tpm).\n\n1.  Add plugin to the list of TPM plugins in `.tmux.conf`:\n\n    ``` tmux\n    set -g @plugin 'tmux-plugins/tmux-yank'\n    ```\n\n2.  Use \u003ckbd\u003eprefix\u003c/kbd\u003e–\u003ckbd\u003eI\u003c/kbd\u003e install `tmux-yank`. You should now\n    be able to `tmux-yank` immediately.\n3.  When you want to update `tmux-yank` use \u003ckbd\u003eprefix\u003c/kbd\u003e–\u003ckbd\u003eU\u003c/kbd\u003e.\n\n### Manual Installation\n\n1.  Clone the repository\n\n    ``` sh\n    $ git clone https://github.com/tmux-plugins/tmux-yank ~/clone/path\n    ```\n\n2.  Add this line to the bottom of `.tmux.conf`\n\n    ``` tmux\n    run-shell ~/clone/path/yank.tmux\n    ```\n\n3.  Reload the `tmux` environment\n\n    ``` sh\n    # type this inside tmux\n    $ tmux source-file ~/.tmux.conf\n    ```\n\nYou should now be able to use `tmux-yank` immediately.\n\nRequirements\n------------\n\nIn order for `tmux-yank` to work, there must be a program that store data in\nthe system clipboard.\n\n### macOS\n\n-   [`reattach-to-user-namespace`](https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard)\n\n**Note**: Some versions of macOS (aka OS X) have been reported to work\nwithout `reattach-to-user-namespace`. It doesn't hurt to have it installed.\n\n-   OS X 10.8: Mountain Lion – *required*\n-   OS X 10.9: Mavericks – *required*\n-   OS X 10.10: Yosemite – *not required*\n-   OS X 10.11: El Capitan – *not required*\n-   macOS 10.12: Sierra – *required*\n-   macOS 10.14: Mojave - *required*\n-   macOS 10.15: Catalina - *not required*\n\nThe easiest way to use `reattach-to-user-namespace` with `tmux` is use to\nuse the [`tmux-sensible`](https://github.com/tmux-plugins/tmux-sensible)\nplugin.\n\nTo use it manually, use:\n\n``` tmux\n# ~/.tmux.conf\nset-option -g default-command \"reattach-to-user-namespace -l $SHELL\"\n```\n\nIf you have `tmux` 1.5 or newer and are using\n[iTerm2](https://www.iterm2.com/) version 3 or newer then the \u003ckbd\u003ey\u003c/kbd\u003e\nin `copy-mode` and mouse selection will work without `tmux-yank`.\n\nTo enable this:\n\n1.  Go into iTerm2's preferences.\n2.  Go to the \"General\" tab.\n3.  Check \"Applications in terminal may access clipboard\"\n4.  In `tmux`, ensure `set-clipboard` is turned on:\n\n    ``` sh\n    $ tmux show-options -g -s set-clipboard\n    set-clipboard on\n    ```\n\n#### [HomeBrew](https://brew.sh/) (recommended)\n\n``` sh\n$ brew install reattach-to-user-namespace\n```\n\n#### MacPorts\n\n``` sh\n$ sudo port install tmux-pasteboard\n```\n\n### Linux\n\n-   `xsel` (recommended) or `xclip` (for X).\n-   `wl-copy` from [wl-clipboard](https://github.com/bugaevc/wl-clipboard) (for Wayland)\n\nIf you have `tmux` 1.5 or newer and are using `xterm`, the \u003ckbd\u003ey\u003c/kbd\u003e in\n`copy-mode` and mouse selection will work without `tmux-yank`. See the\n`tmux(1)` man page entry for the `set-clipboard` option.\n\n#### Debian \u0026 Ubuntu\n\n``` sh\n$ sudo apt-get install xsel # or xclip\n```\n\n#### RedHat \u0026 CentOS\n\n``` sh\n$ sudo yum install xsel # or xclip\n```\n\n### Cygwin\n\n-   (*optional*) `putclip` which is part of the `cygutils-extra` package.\n\n### Windows Subsystem for Linux (WSL)\n\n-   `clip.exe` is shipped with Windows Subsystem for Linux.\n\nConfiguration\n-------------\n\n### Key bindings\n\n-   Normal Mode\n    -   \u003ckbd\u003eprefix\u003c/kbd\u003e–\u003ckbd\u003ey\u003c/kbd\u003e — copies text from the command line\n        to the clipboard.\n\n        Works with all popular shells/repls. Tested with:\n\n        -   shells: `bash`, `zsh` (with `bindkey -e`), `tcsh`\n        -   repls: `irb`, `pry`, `node`, `psql`, `python`, `php -a`,\n            `coffee`\n        -   remote shells: `ssh`, [mosh](http://mosh.mit.edu/)\n        -   vim/neovim command line (requires\n            [vim-husk](https://github.com/bruno-/vim-husk) or\n            [vim-rsi](https://github.com/tpope/vim-rsi) plugin)\n\n    -   \u003ckbd\u003eprefix\u003c/kbd\u003e–\u003ckbd\u003eY\u003c/kbd\u003e — copy the current pane's current\n        working directory to the clipboard.\n\n-   Copy Mode\n    -   \u003ckbd\u003ey\u003c/kbd\u003e — copy selection to system clipboard.\n    -   \u003ckbd\u003eY\u003c/kbd\u003e (shift-y) — \"put\" selection. Equivalent to copying a\n        selection, and pasting it to the command line.\n\n\n### Default and Preferred Clipboard Programs\n\ntmux-yank does its best to detect a reasonable choice for a clipboard\nprogram on your OS.\n\nIf tmux-yank can't detect a known clipboard program then it uses the\n`@custom_copy_command` tmux option as your clipboard program if set.\n\nIf you need to always override tmux-yank's choice for a clipboard program,\nthen you can set `@override_copy_command` to force tmux-yank to use whatever\nyou want.\n\nNote that both programs _must_ accept `STDIN` for the text to be copied.\n\nAn example of setting `@override_copy_command`:\n\n``` tmux\n# ~/.tmux.conf\n\nset -g @custom_copy_command 'my-clipboard-copy --some-arg'\n# or\nset -g @override_copy_command 'my-clipboard-copy --some-arg'\n```\n\n### Linux Clipboards\n\nLinux has several cut-and-paste clipboards: `primary`, `secondary`, and\n`clipboard` (default in tmux-yank is `clipboard`).\n\nYou can change this by setting `@yank_selection`:\n\n``` tmux\n# ~/.tmux.conf\n\nset -g @yank_selection 'primary' # or 'secondary' or 'clipboard'\n```\n\nWith mouse support turned on (see below) the default clipboard for mouse\nselections is `primary`.\n\nYou can change this by setting `@yank_selection_mouse`:\n\n``` tmux\n# ~/.tmux.conf\n\nset -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'\n```\n\n### Controlling Yank Behavior\n\nBy default, `tmux-yank` will exit copy mode after yanking text. If you wish to\nremain in copy mode, you can set `@yank_action`:\n\n``` tmux\n# ~/.tmux.conf\n\nset -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default\n```\n\n### Mouse Support\n\n`tmux-yank` has mouse support enabled by default. It will only work if `tmux`'s\nbuilt-in mouse support is also enabled (with `mouse on` since `tmux` 2.1, or\n`mode-mouse on` in older versions).\n\nTo yank with the mouse, click and drag with the primary button to begin\nselection, and release to yank.\n\nIf you would prefer to disable this behavior, or provide your own bindings for\nthe `MouseDragEnd1Pane` event, you can do so with:\n\n``` tmux\n# ~/.tmux.conf\n\nset -g @yank_with_mouse off # or 'on'\n```\n\nIf you want to remain in copy mode after making a mouse selection, set\n`@yank_action` as described above.\n\n### vi mode support\n\nIf using `tmux` 2.3 or older *and* using vi keys then you'll have add the\nfollowing configuration setting:\n\n``` tmux\n# ~/.tmux.conf\n\nset -g @shell_mode 'vi'\n```\n\nThis isn't needed with `tmux` 2.4 or newer.\n\n### Screen-cast\n\n[![screencast\nscreenshot](/video/screencast_img.png)](https://vimeo.com/102039099)\n\n**Note**: The screen-cast uses \u003ckbd\u003eControl\u003c/kbd\u003e–\u003ckbd\u003ey\u003c/kbd\u003e for\n\"put selection\". Use \u003ckbd\u003eY\u003c/kbd\u003e in `v2.0.0` and later.\n\n### Other tmux plugins\n\n-   [tmux-copycat](https://github.com/tmux-plugins/tmux-copycat) - a plugin\n    for regular expression searches in tmux and fast match selection\n-   [tmux-open](https://github.com/tmux-plugins/tmux-open) - a plugin for\n    quickly opening highlighted file or a URL\n-   [tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) -\n    automatic restoring and continuous saving of tmux environment.\n\n### License\n\n[MIT](LICENSE.md)\n","funding_links":[],"categories":["Shell","Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmux-plugins%2Ftmux-yank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmux-plugins%2Ftmux-yank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmux-plugins%2Ftmux-yank/lists"}