From 8d75b6922b00ba202db2210fc0caa0c265f18035 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 30 May 2016 17:47:32 +0200 Subject: add pp function A function to prevent clipboard hijacking. See: https://github.com/Aaronmsv/PastejackingProtection --- config/fish/functions/pp.fish | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 config/fish/functions/pp.fish (limited to 'config') 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 -- cgit v1.2.3