summaryrefslogtreecommitdiff
path: root/plugins/copyfile
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2015-10-09 07:15:53 -0700
committerRobby Russell <robby@planetargon.com>2015-10-09 07:15:53 -0700
commitdc06e96e9cf52354ac76e9795cc85d528b2d5018 (patch)
tree6cdc6ba4794dffe2cb2189d77cee88ce784e8eb5 /plugins/copyfile
parentb1173d4b30930cdbd69f8c0c029b94f756fe9be7 (diff)
parentb6d78df62c540245f67ffc900d0b1a17a6dfb77e (diff)
downloadzsh-dc06e96e9cf52354ac76e9795cc85d528b2d5018.tar.gz
zsh-dc06e96e9cf52354ac76e9795cc85d528b2d5018.tar.bz2
zsh-dc06e96e9cf52354ac76e9795cc85d528b2d5018.zip
Merge pull request #4254 from apjanke/copyfile-portability
Cross-platform clipboard clipcopy() and clippaste()
Diffstat (limited to 'plugins/copyfile')
-rw-r--r--plugins/copyfile/copyfile.plugin.zsh8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/copyfile/copyfile.plugin.zsh b/plugins/copyfile/copyfile.plugin.zsh
index 944a903c6..f4eca5acf 100644
--- a/plugins/copyfile/copyfile.plugin.zsh
+++ b/plugins/copyfile/copyfile.plugin.zsh
@@ -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
}