summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2026-05-13 08:57:21 -0400
committerMatt Hunter <m@lfurio.us>2026-05-13 08:57:21 -0400
commitf8eaa83cb1ee52ae742e15d91d863247cc37e48a (patch)
tree8a3a32cf39655271d5062849c254bfc21e801e6c
parentb41a90b58fe974cf3e2418c1b19c505d8d187371 (diff)
downloadgit-sonar-f8eaa83cb1ee52ae742e15d91d863247cc37e48a.tar.gz
git-sonar-f8eaa83cb1ee52ae742e15d91d863247cc37e48a.zip
Escape backslashes for \001 and \002 bytes
There are some contexts/shells in which the extra escape character is necessary, so fixup the color constants in git-sonar. Doing so doesn't break any current use-cases. User overrides may or may not need to do the same. Signed-off-by: Matt Hunter <m@lfurio.us>
-rwxr-xr-xgit-sonar12
1 files changed, 6 insertions, 6 deletions
diff --git a/git-sonar b/git-sonar
index e09d6f4..615e053 100755
--- a/git-sonar
+++ b/git-sonar
@@ -71,12 +71,12 @@ precheck_status=$?
# must be enclosed by a \001 byte (ASCII start of heading) at the start and a
# \002 byte (ASCII start of text) at the end - some shells rely on this to
# correctly track the length of their rendered prompt.
-COLOR_GRAY="\001\\033[1;30m\002"
-COLOR_RED="\001\\033[1;31m\002"
-COLOR_GREEN="\001\\033[1;32m\002"
-COLOR_YELLOW="\001\\033[1;33m\002"
-COLOR_WHITE="\001\\033[1;37m\002"
-COLOR_DEF="\001\\033[0m\002"
+COLOR_GRAY="\\001\\033[1;30m\\002"
+COLOR_RED="\\001\\033[1;31m\\002"
+COLOR_GREEN="\\001\\033[1;32m\\002"
+COLOR_YELLOW="\\001\\033[1;33m\\002"
+COLOR_WHITE="\\001\\033[1;37m\\002"
+COLOR_DEF="\\001\\033[0m\\002"
FETCH_TIME="${GIT_SONAR_FETCH_TIME:-"300"}"