diff options
Diffstat (limited to 'config/fish')
| -rw-r--r-- | config/fish/functions/pp.fish | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/config/fish/functions/pp.fish b/config/fish/functions/pp.fish new file mode 100644 index 0000000..6cd9161 --- /dev/null +++ b/config/fish/functions/pp.fish @@ -0,0 +1,17 @@ +function pp --description 'safely execute content from the clipboard' + # fish version of https://github.com/Aaronmsv/PastejackingProtection + + if not type -q xclip + echo please install xclip + return + end + + set script (xclip -o) + echo "$script" | cat -A + echo -e "\nExecute? (y/N): " + read execute + + if test "$execute" = "y" + eval $script + end +end |
