summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-07-05 02:34:26 -0500
committerzachir <zachir@librem.one>2023-07-05 02:34:26 -0500
commitcc47caf5323249c699444f6503fced531feed81c (patch)
tree9ea30654d751c6f3b897d8ba95a113bdef5b218f
parent9066d8473564ac5d8f1e419085d5c9c2045e98a1 (diff)
Add function to not record veracrypt history in zsh
-rw-r--r--sh/functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/sh/functions b/sh/functions
index cbf40ce..3c73fb7 100644
--- a/sh/functions
+++ b/sh/functions
@@ -26,6 +26,18 @@ mvcd () {
mv $@ && cd `ntharg $# "$@"`
}
+if [[ "$SHELL" =~ .*zsh$ ]]; then
+ zshaddhistory () {
+ emulate -L zsh
+ if [[ $1 != *"veracrypt"* ]]; then
+ print -sr -- "${1%%$'\n'}"
+ fc -p
+ else
+ return 1
+ fi
+ }
+fi
+
scd () {
if [ "$1" = "" ]; then
cd $HOME