From d0aff9df460d973311962463ed7b4f176c686731 Mon Sep 17 00:00:00 2001 From: Kitty Cat Date: Wed, 12 Jul 2023 06:41:12 -0400 Subject: [PATCH] zsh: fix context hashing --- zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/zshrc b/zsh/zshrc index 8a2160c..7b58ea2 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -71,7 +71,7 @@ function dotfiles-update() { function context-color() { hexcount=$(($(infocmp -1 | sed -n -e 's/^\t*colors#\([0-9]x\?[0-9]*\),.*/\1/p')-1)) - hash=$(hostname | md5sum | head -c 6 | tr '[:lower:]' '[:upper:]') + hash=$(printf "%d\n" "0x$(hostname | md5sum | head -c 6 | tr '[:lower:]' '[:upper:]')") excludes="0,7,15" id=$(( $hash % $hexcount )) for excid in $(echo "$excludes" | tr "," '\n'); do