Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
f7d4f985
Commit
f7d4f985
authored
Oct 10, 2016
by
Hong
Committed by
Marc Cornellà
Oct 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use $+commands to check the existence of a command in clipboard.zsh. (#5519)
parent
a56eac7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
clipboard.zsh
lib/clipboard.zsh
+4
-4
No files found.
lib/clipboard.zsh
View file @
f7d4f985
...
@@ -31,13 +31,13 @@ function clipcopy() {
...
@@ -31,13 +31,13 @@ function clipcopy() {
cat
$file
>
/dev/clipboard
cat
$file
>
/dev/clipboard
fi
fi
else
else
if
which xclip &>/dev/null
;
then
if
((
$+
commands[xclip]
))
;
then
if
[[
-z
$file
]]
;
then
if
[[
-z
$file
]]
;
then
xclip
-in
-selection
clipboard
xclip
-in
-selection
clipboard
else
else
xclip
-in
-selection
clipboard
$file
xclip
-in
-selection
clipboard
$file
fi
fi
elif
which xsel &>/dev/null
;
then
elif
((
$+
commands[xsel]
))
;
then
if
[[
-z
$file
]]
;
then
if
[[
-z
$file
]]
;
then
xsel
--clipboard
--input
xsel
--clipboard
--input
else
else
...
@@ -74,9 +74,9 @@ function clippaste() {
...
@@ -74,9 +74,9 @@ function clippaste() {
elif
[[
$OSTYPE
==
cygwin
*
]]
;
then
elif
[[
$OSTYPE
==
cygwin
*
]]
;
then
cat
/dev/clipboard
cat
/dev/clipboard
else
else
if
which xclip &>/dev/null
;
then
if
((
$+
commands[xclip]
))
;
then
xclip
-out
-selection
clipboard
xclip
-out
-selection
clipboard
elif
which xsel &>/dev/null
;
then
elif
((
$+
commands[xsel]
))
;
then
xsel
--clipboard
--output
xsel
--clipboard
--output
else
else
print
"clipcopy: Platform
$OSTYPE
not supported or xclip/xsel not installed"
>
&2
print
"clipcopy: Platform
$OSTYPE
not supported or xclip/xsel not installed"
>
&2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment