fish_clipboard_copy foo | fish_clipboard_copy
The fish_clipboard_copy function copies text to the system clipboard.
If stdin is not a terminal (see isatty), it will read all input from there and copy it. If it is, it will use the current commandline, or the current selection if there is one.
It is bound to ctrl-x by default.
fish_clipboard_copy works by calling a system-specific backend. If it doesn’t appear to work you may need to install yours.
Currently supported are:
pbcopywl-copy using waylandxsel and xclip for X11clip.exe on Windows.
© 2005-2009 Axel Liljencrantz, 2009-2026 fish-shell contributors
Licensed under the GNU General Public License, version 2.
https://fishshell.com/docs/4.5/cmds/fish_clipboard_copy.html