{"id":13342536,"url":"https://github.com/memoryInject/wsl-clipboard","last_synced_at":"2025-03-12T01:37:39.282Z","repository":{"id":60072878,"uuid":"540899230","full_name":"memoryInject/wsl-clipboard","owner":"memoryInject","description":"Blazingly fast⚡ Windows clipboard 📋 utility for WSL applications and Neovim running under WSL","archived":false,"fork":false,"pushed_at":"2022-11-08T13:10:47.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-30T21:04:41.363Z","etag":null,"topics":["clipboard","neovim","visual-studio","windows","wsl","wsl-ubuntu","wsl2"],"latest_commit_sha":null,"homepage":"","language":"C++","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/memoryInject.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}},"created_at":"2022-09-24T16:47:23.000Z","updated_at":"2024-05-20T13:39:26.000Z","dependencies_parsed_at":"2023-01-22T11:31:01.953Z","dependency_job_id":null,"html_url":"https://github.com/memoryInject/wsl-clipboard","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fwsl-clipboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fwsl-clipboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fwsl-clipboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memoryInject%2Fwsl-clipboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memoryInject","download_url":"https://codeload.github.com/memoryInject/wsl-clipboard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221260200,"owners_count":16787078,"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","neovim","visual-studio","windows","wsl","wsl-ubuntu","wsl2"],"created_at":"2024-07-29T19:29:30.561Z","updated_at":"2024-10-24T01:31:16.583Z","avatar_url":"https://github.com/memoryInject.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# wsl-clipboard 📋\n\nBlazingly fast Windows clipboard utility for WSL applications and Neovim running under WSL.     \nBuild using Microsoft Visual Studio Community \n2019 Version 16.11.19 on Windows 10 Version 21H2 (OS Build 19044.2006).\n\n## Features\n\n- Get and set windows clipboard\n- Support Unicode characters\n- Additional shell script for WSL for removing CR end of a line\n- Support Neovim \n- Support Tmux \n\n\n## Installation\n\nInstall wsl-clipboard by download Windows executable and shell scripts from [release page](https://github.com/memoryInject/wsl-clipboard/releases/tag/v0.1.0)\n\n```bash\n  wget https://github.com/memoryInject/wsl-clipboard/releases/download/v0.1.0/wclip.exe\n  wget https://github.com/memoryInject/wsl-clipboard/releases/download/v0.1.0/wcopy\n  wget https://github.com/memoryInject/wsl-clipboard/releases/download/v0.1.0/wpaste\n```\n\nAfter downloading `wclip.exe, wcopy and wpaste`:  \nMove wclip.exe into `C:\\Windows\\System32\\` or any other Windows file system location that is on system `PATH`.\n\n**NOTE: do not copy wclip.exe in WSL file system location, it will slow down the executaion of Windows applications).   \n\nNext move `wcopy and wpaste` into WSL file system location `/usr/bin/`.\n## Usage/Examples\n### wclip.exe usage:\nExecute wclip.exe under WSL bash terminal.  \nTo get all the help run `wclip.exe --help`:\n\n```bash\n~\n❯ wclip.exe --help\nusage: wclip.exe [\u003cflags\u003e]\n\nWSL-Clipboard Utility\n\nBlazingly fast Windows clipboard utility for WSL applications and Neovim running under WSL\n\n\n\nFlags:\n  -h, --help                  Show help\n  -o, --output                Output clipboard contents\n  -i, --input \u003cinput-text\u003e    Input clipboard contents\n\n```\n\nSet clipboard content `wclip.exe -i \"Hello world 😀\"`\n\n```bash\n~                                                                                         ✘ INT\n❯ wclip.exe -i \"你好 😀\"\n```\n\nGet clipboard content `wclip.exe -o` or exetute without any flags `wclip.exe`\n```bash\n❯ wclip.exe --output\n你好 😀  \n```\n\nIt also support pips `echo \"Hello world!\" | wclip.exe -i`\n```bash\n~\n❯ echo \"Hello World! 😎\" | wclip.exe -i\n~\n❯ wclip.exe\nHello World! 😎\n```\n\n### wcopy and wpaste usage:\n`wcopy and wpaste` are shell script for easy usage in WSL, `wpaste` also remove `CR` at the end of the line which is came from Windows side.\n\n`wcopy` usage, it only support pipes.\n`wpaste` will output contents from clipboard, both of them do not support any flags.\n```bash\n~\n❯ echo \"Hello\" | wcopy\n~\n❯ wpaste\nHello\n```\n\nThe main reason these sctipts exists is, it is easy to use with Neovim and Tmux when we use system clipboard.\n\n### Neovim integration\nIf you are running Neovim under WSL and want to use system clipboard, add the lua script into your configuration:\n```lua\nvim.opt.clipboard = \"unnamedplus\"               -- allows neovim to access the system clipboard\n\n-- Set wsl-clipboard for vim clipboard if running WSL\n-- Check if the current linux kernal is microsoft WSL version\nlocal function is_wsl()\n  local version_file = io.open(\"/proc/version\", \"rb\")\n  if version_file ~= nil and string.find(version_file:read(\"*a\"), \"microsoft\") then\n    version_file:close()\n    return true\n  end\n  return false\nend\n\n-- If current linux is under WSL then use wclip.exe\n-- More info: https://github.com/memoryInject/wsl-clipboard\nif is_wsl() then\n  vim.g.clipboard = {\n    name = \"wsl-clipboard\",\n    copy = {\n      [\"+\"] = \"wcopy\",\n      [\"*\"] = \"wcopy\"\n    },\n    paste = {\n      [\"+\"] = \"wpaste\",\n      [\"*\"] = \"wpaste\"\n    },\n    cache_enabled = true\n  }\nend\n\n```\n\n### Tmux integration\nIf you are running Tmux under WSL and want to use system clipboard for vi style yank, add the script into tmux configuration:\n```tmux\n# Vim like selection and copy text\nbind -T copy-mode-vi v send-keys -X begin-selection\nbind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'wcopy'\n```\n## Screenshots\n\n\u003cimg src=\"https://user-images.githubusercontent.com/72661846/193530685-24a11425-5dcf-474a-b763-cb98325f2845.jpg\" width=\"600\"\u003e\n\n\n## Alternatives\nIf you find that wsl-clipboard doesn't quite satisfy your requirements, these may be a better fit:\n- [win32yank](https://github.com/equalsraf/win32yank)\n\n\n## Contributing\n\nContributions are always welcome!\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n\n## Support\n\nFor support, email msmahesh@live.com.  \n\nMore info: www.memoryinject.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FmemoryInject%2Fwsl-clipboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FmemoryInject%2Fwsl-clipboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FmemoryInject%2Fwsl-clipboard/lists"}