summaryrefslogtreecommitdiff
path: root/st-copyout
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-04-15 16:43:26 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-04-15 16:43:26 -0400
commit1d1fefcd7b7df5736b510d9aeb812befe4b8fdf6 (patch)
treecb7ec258c7ec898a22b2eadd2551a246ca417dd7 /st-copyout
parentbaa9fa076a4e334e04532b218a925b0a8e367a8c (diff)
parent1832b84873408df2ef0db2b1e594bf1227fcb793 (diff)
Merge branch 'master' of github.com:LukeSmithxyz/st
Diffstat (limited to 'st-copyout')
-rwxr-xr-xst-copyout1
1 files changed, 1 insertions, 0 deletions
diff --git a/st-copyout b/st-copyout
index 8eafc58..0d19e5a 100755
--- a/st-copyout
+++ b/st-copyout
@@ -6,6 +6,7 @@
tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX)
trap 'rm "$tmpfile"' 0 1 15
sed -n "w $tmpfile"
+sed -i 's/\x0//g' "$tmpfile"
ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^\s*//' | cut -d' ' -f1)"
chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')"
eps1="$(echo "$ps1" | sed 's/[^^]/[&]/g; s/\^/\\^/g')"