mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-10 02:09:51 +00:00
Add clipcopy() and clippaste() generic cross-platform CLI clipboard functions.
Change copydir, copyfile, and coffee plugins to use them, instead of the Mac-only `pbcopy` command.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# Copies the contents of a given file to the system or X Windows clipboard
|
||||
#
|
||||
# copyfile <file>
|
||||
function copyfile {
|
||||
[[ "$#" != 1 ]] && return 1
|
||||
local file_to_copy=$1
|
||||
cat $file_to_copy | pbcopy
|
||||
emulate -L zsh
|
||||
clipcopy $1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user