summaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-09-16 02:48:56 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-09-16 02:48:56 +0000
commit43e87b8a95aa36ab5a7f78de3034e081bac2e8ad (patch)
tree8620e769fd58379a8dfa34529aa8688cd9356c60 /console
parenta618f28ce12e97bfffea729bdf421c38a236f9ca (diff)
hurd/
2002-09-16 Marcus Brinkmann <marcus@gnu.org> * console.h (conchar_attr_t): Add bits for italic and bold text attributes. console/ 2002-09-16 Marcus Brinkmann <marcus@gnu.org> * hurd.ti: Add capabilities <sitm>, <ritm>, <gsbom>, <grbom>. * display.c (handle_esc_bracket_m): Add support for italic. (display_output_one): Add new capabilities PU1 and PU2 to toggle bold mode. Reset PARSE->state on most escape sequences. * console.c (parse_attributes): Rename old bold attribute to bright. Add support for italic and bold.
Diffstat (limited to 'console')
-rw-r--r--console/ChangeLog9
-rw-r--r--console/console.c14
-rw-r--r--console/display.c19
-rw-r--r--console/hurd.ti5
4 files changed, 43 insertions, 4 deletions
diff --git a/console/ChangeLog b/console/ChangeLog
index e1bed32c..58dbcf17 100644
--- a/console/ChangeLog
+++ b/console/ChangeLog
@@ -1,3 +1,12 @@
+2002-09-16 Marcus Brinkmann <marcus@gnu.org>
+
+ * hurd.ti: Add capabilities <sitm>, <ritm>, <gsbom>, <grbom>.
+ * display.c (handle_esc_bracket_m): Add support for italic.
+ (display_output_one): Add new capabilities PU1 and PU2 to toggle
+ bold mode. Reset PARSE->state on most escape sequences.
+ * console.c (parse_attributes): Rename old bold attribute to
+ bright. Add support for italic and bold.
+
2002-09-10 Marcus Brinkmann <marcus@gnu.org>
* display.c (DISPLAY_CHANGE_FLAGS): New macro.
diff --git a/console/console.c b/console/console.c
index 3896f361..48567e1f 100644
--- a/console/console.c
+++ b/console/console.c
@@ -1360,9 +1360,9 @@ parse_attributes (const char *name, conchar_attr_t *attr)
return EINVAL;
attr->intensity = CONS_ATTR_INTENSITY_NORMAL;
}
- else if (!strncmp (name, "bold", 4))
+ else if (!strncmp (name, "bright", 6))
{
- name += 4;
+ name += 6;
if (value != 1)
return EINVAL;
attr->intensity = CONS_ATTR_INTENSITY_BOLD;
@@ -1389,6 +1389,16 @@ parse_attributes (const char *name, conchar_attr_t *attr)
name += 9;
attr->concealed = value;
}
+ else if (!strncmp (name, "italic", 6))
+ {
+ name += 6;
+ attr->italic = value;
+ }
+ else if (!strncmp (name, "bold", 4))
+ {
+ name += 4;
+ attr->bold = value;
+ }
else
return EINVAL;
diff --git a/console/display.c b/console/display.c
index d11091b4..352e41c4 100644
--- a/console/display.c
+++ b/console/display.c
@@ -1000,6 +1000,10 @@ handle_esc_bracket_m (attr_t attr, int code)
/* Dim on: <dim>. */
attr->current.intensity = CONS_ATTR_INTENSITY_DIM;
break;
+ case 3:
+ /* Italic on: <sitm>. */
+ attr->current.italic = 1;
+ break;
case 4:
/* Underline on: <smul>. */
attr->current.underlined = 1;
@@ -1028,6 +1032,10 @@ handle_esc_bracket_m (attr_t attr, int code)
/* Normal intensity. */
attr->current.intensity = CONS_ATTR_INTENSITY_NORMAL;
break;
+ case 23:
+ /* Italic off: <ritm>. */
+ attr->current.italic = 1;
+ break;
case 24:
/* Underline off: <rmul>. */
attr->current.underlined = 0;
@@ -1521,6 +1529,7 @@ display_output_one (display_t display, wchar_t chr)
break;
case STATE_ESC:
+ parse->state = STATE_NORMAL;
switch (chr)
{
case L'[':
@@ -1539,7 +1548,6 @@ display_output_one (display_t display, wchar_t chr)
L' ', display->attr.current);
user->cursor.col = user->cursor.row = 0;
/* XXX Flag cursor change. */
- parse->state = STATE_NORMAL;
break;
case L'E': /* ECMA-48 <NEL>. */
/* Newline. */
@@ -1562,9 +1570,16 @@ display_output_one (display_t display, wchar_t chr)
/* Visible bell. */
user->bell.visible++;
break;
+ case L'Q': /* ECMA-48 <PU1>. */
+ /* Bold on: <gsbom>. This is a GNU extension. */
+ display->attr.current.bold = 1;
+ break;
+ case L'R': /* ECMA-48 <PU2>. */
+ /* Bold off: <grbom>. This is a GNU extension. */
+ display->attr.current.bold = 0;
+ break;
default:
/* Unsupported escape sequence. */
- parse->state = STATE_NORMAL;
break;
}
break;
diff --git a/console/hurd.ti b/console/hurd.ti
index eb9d57b9..d0496d26 100644
--- a/console/hurd.ti
+++ b/console/hurd.ti
@@ -153,6 +153,11 @@ hurd|The GNU Hurd console server,
smso=\E[7m, rmso=\E[27m,
# Enable (disable) underline mode.
smul=\E[4m, rmul=\E[24m,
+# Enable (disable) italic mode.
+ sitm=\E[3m, ritm=\E[23m,
+# Enable (disable) real bold (not intensity bright) mode. This is a
+# GNU extension.
+ gsbom=\EQ, grbom=\ER,
# XXX Linux has those also for rmpch and smpch.
# Enable (disable) alternative character set.
smacs=\E[11m, rmacs=\E[10m,