From ba02955340e84bff4f6d90883eafdcfab341c9e2 Mon Sep 17 00:00:00 2001 From: Oliver Ruben Albertini Date: Sat, 12 Sep 2020 09:54:47 -0700 Subject: [PATCH] hg SCM_CHANGE: prevent hexdump squeezing hexdump by default will replace any repeated groups with an asterisk and a newline, which breaks prompts. This can be disabled with the `-v` flag. For example: ``` printf 'aac' | hexdump -e '1/1 "%02x"' 61* 63 printf 'abc' | hexdump -e '1/1 "%02x"' 616263 printf 'aac' | hexdump -ve '1/1 "%02x"' 616163 ``` --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 61671b51..58246720 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -344,7 +344,7 @@ function hg_prompt_vars { if [ -f "$HG_ROOT/dirstate" ]; then # Mercurial holds various information about the working directory in .hg/dirstate file. More on http://mercurial.selenic.com/wiki/DirState - SCM_CHANGE=$(hexdump -n 10 -e '1/1 "%02x"' "$HG_ROOT/dirstate" | cut -c-12) + SCM_CHANGE=$(hexdump -vn 10 -e '1/1 "%02x"' "$HG_ROOT/dirstate" | cut -c-12) else SCM_CHANGE=$(hg summary 2> /dev/null | grep parent: | awk '{print $2}') fi