summaryrefslogtreecommitdiffstats
path: root/grid.c
diff options
context:
space:
mode:
authornicm <nicm>2018-10-18 07:57:57 +0000
committernicm <nicm>2018-10-18 07:57:57 +0000
commitbc0e527f32642cc9eb2354d1bdc033ab6beca33b (patch)
treea6b154e707a0fad14f57ba8940f76cba024e0330 /grid.c
parentf7c85f3ed8f151501fb72a1c18a48d126d89c83c (diff)
Support for extended underline styles on terminals which offer them,
enabled by adding the Smulx capability with terminal-overrides (add something like ',vte*:Smulx=\E[4\:%p1%dm'). GitHub issue 1492.
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/grid.c b/grid.c
index dcfd95fe..a7c9a67e 100644
--- a/grid.c
+++ b/grid.c
@@ -764,7 +764,11 @@ grid_string_cells_code(const struct grid_cell *lastgc,
{ GRID_ATTR_BLINK, 5 },
{ GRID_ATTR_REVERSE, 7 },
{ GRID_ATTR_HIDDEN, 8 },
- { GRID_ATTR_STRIKETHROUGH, 9 }
+ { GRID_ATTR_STRIKETHROUGH, 9 },
+ { GRID_ATTR_UNDERSCORE_2, 42 },
+ { GRID_ATTR_UNDERSCORE_3, 43 },
+ { GRID_ATTR_UNDERSCORE_4, 44 },
+ { GRID_ATTR_UNDERSCORE_5, 45 },
};
n = 0;
@@ -790,11 +794,15 @@ grid_string_cells_code(const struct grid_cell *lastgc,
else
strlcat(buf, "\033[", len);
for (i = 0; i < n; i++) {
- if (i + 1 < n)
- xsnprintf(tmp, sizeof tmp, "%d;", s[i]);
- else
+ if (s[i] < 10)
xsnprintf(tmp, sizeof tmp, "%d", s[i]);
+ else {
+ xsnprintf(tmp, sizeof tmp, "%d:%d", s[i] / 10,
+ s[i] % 10);
+ }
strlcat(buf, tmp, len);
+ if (i + 1 < n)
+ strlcat(buf, ";", len);
}
strlcat(buf, "m", len);
}