Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Misc/colors submission for review and consideration
- X-seq: zsh-workers 55117
- From: Jim <linux.tech.guy@xxxxxxxxx>
- To: devs <zsh-workers@xxxxxxx>
- Subject: [PATCH] Misc/colors submission for review and consideration
- Date: Sun, 23 Aug 2026 15:17:08 -0500
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:reply-to:mime-version :dkim-signature; bh=pPWJmokm5rMqyTva+5c7ubChW6nr9f3YIHD54eJlKTA=; fh=dy7eOiV8tZuVXTXi0HGvcglPxdYpbdHd8nqYKpgb698=; b=btczrGWjBLExNyLdw8fyVsSw4KiyEkRKVGw1NCB0O1wYV+eWHbuQfrNmMOu31CZiTJ RPGTY56/iWUtyEXmRlxSjsr3I6EAi39NJcx3jDalBQMxY64YlnfFtWynM6Je8eHtFJ3Z Ya7xuy84qt9+tbaj1FEKxvujNwee9AVwCaC2ZBibBqAVHKfT0rCDJEDynyEZX7l4eX6j TxyxPBqHSZ/uz/ICqz3YDhYJ00psZ/y9z33s7Ylmxo87Xi7ZheBUipF8stgz7JZ5PM+p KxHq3VWX17OuyGIe49FwcgeOi4CkcHNmNVqN+n3CqX/uGnz4suefGUm3qVp6OsfaQUou //Iw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1787516241; cv=none; d=google.com; s=arc-20260327; b=T6BUOU7tGxHvZWiuQ+XJKK+Kmzyj2FjOg2wZ6FE7DyU0TChkGU0/7sOJ3IoBQd80Ts azS8nC3jy56eYvgx961l1AG1MdDbMtublOnJvSbNHs/sg1BJ7cMbw6HWunLR1HCxvfjq p2EThf7ztX5lEk82zrWTzQ/hT9QWA8b6koN6NpOgGHCFzmi8cQ4gxPEXI1bbleMGd/la gCTiefscojuiNjv0g1AxzfWJxsCzv3FBG50VpSphhD4x+OG0KEHkAvd7dDnwluFbA4sn 40u5ufC2qoLVQTwCK2weJAse6p82f6gcwtKagd7Fkgwf/Q2/pFqu28H3nk6GOoyI2yrT yoGQ==
- Archived-at: <https://zsh.org/workers/55117>
- List-id: <zsh-workers.zsh.org>
- Reply-to: linuxtechguy@xxxxxxxxx
Hello all,
As already stated in the comments in the function colors, a number of attributes are
"included for completeness". Would any of the attached additions be appropriate?
I'm more than open to any suggestions, corrections or changes if needed, if any of
this is considered to be useful and hopefully not overkill.
What is already in colors has been very useful and a valuable resource that
didn't require outside research to find. A note in the man page suggesting
that looking at the code with its comments may be very helpful especially for
new users.
Thanks for your time.
Regards,
Jim Murphy
diff --git a/Functions/Misc/colors b/Functions/Misc/colors
index 8a0cec383..0964c0791 100644
--- a/Functions/Misc/colors
+++ b/Functions/Misc/colors
@@ -9,6 +9,7 @@ color=(
# Codes listed in this array are from ECMA-48, Section 8.3.117, p. 61.
# Those that are commented out are not widely supported or aren't closely
# enough related to color manipulation, but are included for completeness.
+# All codes need to be seperated by semi-colons(;), except as noted below.
# Attribute codes:
00 none # 20 gothic
@@ -23,6 +24,58 @@ color=(
08 conceal 28 no-conceal
# 09 strikethrough # 29 no-strikethrough
+# Additional information about the bold attribute. On a number of terminal
+# emulators bold also changes the output to "bright" by default. In most cases
+# going into the colors portion of the emulators settings there is an option to
+# turn this action off. The option is sometimes labeled "bright on bold" or
+# something to the effect. One exception, kitty does not support bright on bold.
+
+# The following are Extended Underline SGR codes not defined in either
+# console_codes(4) or ECMA-48 but adopted by several terminal emulators(kitty,
+# iTerm2, WezTerm, Otty) either in part or as a whole. The following was taken
+# from https://docs.otty.sh/vt/csi/sgr. (It would appear that VTE based
+# terminal emeulators may also support this: tested on xfce4-terminal.)
+
+# NOTE: Tmux multiplexer, even if running on a terminal emulator that supports
+# many of these Extension, currently does not support them.
+
+# NOTE: Extended codes are seperated by colons(:).
+
+# 4:0 None # clears underline
+# 4:1 Single # 2 px underline (also via plain \e[4m)
+# 4:2 Double # two stacked 2 px lines (use 4:2, not \e[21m — under ECMA-48,
+# # 21 resets bold)
+# 4:3 Curly # (undercurl) square-wave wavy line, fg or SGR 58 colored
+# 4:4 Dotted # repeating dot pattern
+# 4:5 Dashed # repeating short-dash pattern
+
+# 58:5:<n>
+# 58:2:<r>:<g>:<b>
+ # Underline color (independent of text color) applied to single /
+ # double / curly / dotted / dashed
+# 59 reset-underline-color # back to text color
+
+# NOTE: kitty's writers usually emit the colon form 58:2::R:G:B (the empty
+# colorspace slot before the RGB triple); the semicolon form 58;2;R;G;B is
+# also accepted.
+
+# The following SGR codes, as definded in console_codes(4), are supported in the
+# Linux kernel for terminal devices(/dev/tty[1-<N>]).
+# 10 toggle-meta-flag
+ # reset selected mapping, display control flag, and toggle meta flag
+# 11 reset-toggle-meta-flag
+ # select null mapping, set display control flag, reset toggle meta flag
+# 12 set-toggle-meta-flag
+ # select null mapping, set display control flag, set toggle meta flag
+ # The toggle meta flag causes the high bit of a byte to be toggled before
+ # the mapping table translation is done.
+
+# Font selection:
+# The following are defined in ECMA-48. Its orginal purpose was to be able to
+# switch between fonts that were stored on ROM in hardware terminals. As modern
+# day virtual terminals do not have this hardware feature it is generally
+# ignored or not supported.
+
# Font selection:
# 10 font-default
# 11 font-first
@@ -47,6 +100,12 @@ color=(
# 38 iso-8613-6 # 48 bg-iso-8613-6
39 default 49 bg-default
+# 38 and 48 Usage:
+# 38;<N> select color form terminal emulator predifined 256 color chart
+# 38;<red>;<green>;<blue> for true/24bit color terminals
+# allowabe range for each color <0-255>.
+# 48 Same as with 38
+
# Other codes:
# 50 no-proportional
# 51 border-rectangle
@@ -54,8 +113,11 @@ color=(
# 53 overline
# 54 no-border
# 55 no-overline
-# 56 through 59 reserved
-
+# 56 through 59 reserved (ECMA-48)
+# Exceptions:
+# 58 See Extended Underline SRG codes(above)
+# 59 See Extended Underline SRG codes(above)
+#
# Ideogram markings:
# 60 underline-or-right
# 61 double-underline-or-right
Messages sorted by:
Reverse Date,
Date,
Thread,
Author