mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
clipcopy interprets empty filename as stdin, but the current "error handling" breaks its behavior. This bug was introduced in ohmyzsh/ohmyzsh#13248.
13 lines
277 B
Bash
13 lines
277 B
Bash
# Copies the contents of a given file to the system or X Windows clipboard
|
|
#
|
|
# Usage: copyfile <file>
|
|
function copyfile {
|
|
emulate -L zsh
|
|
|
|
clipcopy "${1-}" || {
|
|
echo "Usage: copyfile <file>"
|
|
return 1
|
|
}
|
|
|
|
echo ${(%):-"%B${1:-/dev/stdin}%b copied to clipboard."}
|
|
}
|