Skip to content

Commit

Permalink
Change 'freset' and 'breset' color keywords to 'fgreset' and 'bgreset'
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-arch committed Sep 27, 2024
1 parent a57b9f8 commit 82c9c6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions misc/prompts.clifm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
# ---------
#
# Colorization is made using either of the two following methods:
# 1) Bash-style full escape sequences (e.g. "\[\e[1;31m\]", for bold red)
# 1) Bash-style ANSI escape codes (e.g. "\[\e[1;31m\]", for bold red)
#
# 2) Using the %{COLOR} syntax, where COLOR is:
# a) A color/attribute name:
Expand All @@ -123,8 +123,11 @@
# prints "text" twice, first in a bold underlined bright red, and then
# in a bold bright red (no underline).
#
# Use the special "freset" and "breset" keywords to set the foreground
# and background color respectively to the default terminal value.
# Use the special "fgreset" and "bgreset" keywords to set the foreground
# and background color respectively to the default terminal value. For
# example, "%{k:red}%{blue}test%{bgreset}" prints "test" in blue on a
# red background, and then resets the background color (keeping the
# foreground color).
#
# b) A number in the range 0-255 (256-colors). E.g. "%{196}"
#
Expand Down
4 changes: 2 additions & 2 deletions src/prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ gen_color(char **line)
GEN_ATTR(no_attr ? "24" : "4");
} else if (l[0] == 's' && strcmp(l, "strike") == 0) {
GEN_ATTR(no_attr ? "29" : "9");
} else if (l[0] == 'f' && strcmp(l, "freset") == 0) {
} else if (l[0] == 'f' && l[1] == 'g' && strcmp(l + 2, "reset") == 0) {
GEN_ATTR("39");
} else if (l[0] == 'b' && strcmp(l, "breset") == 0) {
} else if (l[0] == 'b' && l[1] == 'g' && strcmp(l + 2, "reset") == 0) {
GEN_ATTR("49");
} else if (IS_DIGIT(l[0]) && (!l[1] || (is_number(l + 1)
&& (n = atoi(l)) <= 255))) {
Expand Down

0 comments on commit 82c9c6e

Please sign in to comment.