|
@@ -1,11 +1,19 @@
|
1
|
1
|
#!/bin/bash
|
|
2
|
+#shellcheck disable=SC1087,SC2034
|
2
|
3
|
|
3
|
4
|
#
|
4
|
5
|
# Context symbol used in title and prompt
|
5
|
6
|
#
|
6
|
7
|
BASHUM_CTXSYM=${BASHUM_CTXSYM:-}
|
7
|
8
|
|
8
|
|
-# get some fancy colorz
|
|
9
|
+#
|
|
10
|
+# ANSI color codes
|
|
11
|
+#
|
|
12
|
+# Don't use these in prompts or line editing will likely be
|
|
13
|
+# broken. (Bash/readline will count these character despite
|
|
14
|
+# the fact they don't move the cursor.) Use BASHUM_PS_COLOR_*
|
|
15
|
+# instead.
|
|
16
|
+#
|
9
|
17
|
BASHUM_COLOR_BLACK=$'\033[0;30m'
|
10
|
18
|
BASHUM_COLOR_RED=$'\033[0;31m'
|
11
|
19
|
BASHUM_COLOR_GREEN=$'\033[0;32m'
|
|
@@ -24,7 +32,13 @@ BASHUM_COLOR_LCYAN=$'\033[1;36m'
|
24
|
32
|
BASHUM_COLOR_LWHITE=$'\033[1;37m'
|
25
|
33
|
BASHUM_COLOR_NORMAL=$'\033[1;0m'
|
26
|
34
|
|
27
|
|
-# get some fancy colorz
|
|
35
|
+#
|
|
36
|
+# ANSI color codes
|
|
37
|
+#
|
|
38
|
+# Unlike BASHUM_COLOR_*, these have extra escapes for Bash
|
|
39
|
+# so that they can be used in Bash prompt without breaking
|
|
40
|
+# line editing.
|
|
41
|
+#
|
28
|
42
|
BASHUM_PS_COLOR_BLACK=$'\[\033[0;30m\]'
|
29
|
43
|
BASHUM_PS_COLOR_RED=$'\[\033[0;31m\]'
|
30
|
44
|
BASHUM_PS_COLOR_GREEN=$'\[\033[0;32m\]'
|
|
@@ -43,7 +57,6 @@ BASHUM_PS_COLOR_LCYAN=$'\[\033[1;36m\]'
|
43
|
57
|
BASHUM_PS_COLOR_LWHITE=$'\[\033[1;37m\]'
|
44
|
58
|
BASHUM_PS_COLOR_NORMAL=$'\[\033[1;0m\]'
|
45
|
59
|
|
46
|
|
-#shellcheck disable=SC1087
|
47
|
60
|
bashum__colordemo() {
|
48
|
61
|
local bla=$BASHUM_COLOR_BLACK
|
49
|
62
|
local red=$BASHUM_COLOR_RED
|