💾 Archived View for thrig.me › blog › 2023 › 11 › 07 › st-nocolor.patch captured on 2024-08-18 at 20:44:42.

View Raw

More Information

⬅️ Previous capture (2023-11-14)

-=-=-=-=-=-=-

--- st.c
+++ st.c
@@ -1363,86 +1363,25 @@ tsetattr(const int *attr, int l)
 				ATTR_REVERSE    |
 				ATTR_INVISIBLE  |
 				ATTR_STRUCK     );
-			term.c.attr.fg = defaultfg;
-			term.c.attr.bg = defaultbg;
 			break;
 		case 1:
 			term.c.attr.mode |= ATTR_BOLD;
 			break;
-		case 2:
-			term.c.attr.mode |= ATTR_FAINT;
-			break;
-		case 3:
-			term.c.attr.mode |= ATTR_ITALIC;
-			break;
 		case 4:
 			term.c.attr.mode |= ATTR_UNDERLINE;
 			break;
-		case 5: /* slow blink */
-			/* FALLTHROUGH */
-		case 6: /* rapid blink */
-			term.c.attr.mode |= ATTR_BLINK;
-			break;
 		case 7:
 			term.c.attr.mode |= ATTR_REVERSE;
 			break;
-		case 8:
-			term.c.attr.mode |= ATTR_INVISIBLE;
-			break;
-		case 9:
-			term.c.attr.mode |= ATTR_STRUCK;
-			break;
 		case 22:
 			term.c.attr.mode &= ~(ATTR_BOLD | ATTR_FAINT);
 			break;
-		case 23:
-			term.c.attr.mode &= ~ATTR_ITALIC;
-			break;
 		case 24:
 			term.c.attr.mode &= ~ATTR_UNDERLINE;
 			break;
-		case 25:
-			term.c.attr.mode &= ~ATTR_BLINK;
-			break;
 		case 27:
 			term.c.attr.mode &= ~ATTR_REVERSE;
 			break;
-		case 28:
-			term.c.attr.mode &= ~ATTR_INVISIBLE;
-			break;
-		case 29:
-			term.c.attr.mode &= ~ATTR_STRUCK;
-			break;
-		case 38:
-			if ((idx = tdefcolor(attr, &i, l)) >= 0)
-				term.c.attr.fg = idx;
-			break;
-		case 39:
-			term.c.attr.fg = defaultfg;
-			break;
-		case 48:
-			if ((idx = tdefcolor(attr, &i, l)) >= 0)
-				term.c.attr.bg = idx;
-			break;
-		case 49:
-			term.c.attr.bg = defaultbg;
-			break;
-		default:
-			if (BETWEEN(attr[i], 30, 37)) {
-				term.c.attr.fg = attr[i] - 30;
-			} else if (BETWEEN(attr[i], 40, 47)) {
-				term.c.attr.bg = attr[i] - 40;
-			} else if (BETWEEN(attr[i], 90, 97)) {
-				term.c.attr.fg = attr[i] - 90 + 8;
-			} else if (BETWEEN(attr[i], 100, 107)) {
-				term.c.attr.bg = attr[i] - 100 + 8;
-			} else {
-				fprintf(stderr,
-					"erresc(default): gfx attr %d unknown\n",
-					attr[i]);
-				csidump();
-			}
-			break;
 		}
 	}
 }