Browse Source

ix: remove trailing newline when copying to clipboard

DanielFGray 2 years ago
parent
commit
2ee44cc9fa
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      ix

+ 3
- 3
ix View File

@@ -4,7 +4,7 @@ declare -r esc=$'\033'
4 4
 declare -r c_reset="${esc}[0m"
5 5
 declare -r c_red="${esc}[31m"
6 6
 declare OPTIND
7
-declare opts=( -# )
7
+declare -a opts=( -\# )
8 8
 declare id
9 9
 
10 10
 usage() {
@@ -141,9 +141,9 @@ if [[ -t 0 ]]; then
141 141
     filename="$1"
142 142
     shift
143 143
     response=$(curl "${opts[@]}" -F f:1=@"$filename" "$@" "ix.io/$id")
144
-    clipboard=$(select_from 'xclip' 'xsel')
144
+    clipboard=$(select_from 'xclip -r ' 'xsel')
145 145
     if [[ -n "$clipboard" ]]; then
146
-      tee <<< "$response" | $clipboard
146
+      tee /dev/tty <<< "$response" | $clipboard
147 147
     else
148 148
       echo "$response"
149 149
     fi

Loading…
Cancel
Save