aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/teken/gensequences1
-rw-r--r--sys/teken/sequences3
-rw-r--r--sys/teken/teken.h1
-rw-r--r--sys/teken/teken_subr.h12
4 files changed, 16 insertions, 1 deletions
diff --git a/sys/teken/gensequences b/sys/teken/gensequences
index a18e7a12fe04..49cd771ed064 100644
--- a/sys/teken/gensequences
+++ b/sys/teken/gensequences
@@ -158,6 +158,7 @@ for (p in l_prefix_name) {
if (l_prefix_name[p] != "teken_state_init") {
print "";
+ print "\tt->t_last = 0;";
print "\tteken_state_switch(t, teken_state_init);";
}
print "}";
diff --git a/sys/teken/sequences b/sys/teken/sequences
index 0224584bea26..921dcce56692 100644
--- a/sys/teken/sequences
+++ b/sys/teken/sequences
@@ -114,3 +114,6 @@ C25VTSW Cons25 switch virtual terminal ^[ [ z r
# VT52 compatibility
#DECID VT52 DECID ^[ Z
+
+# ECMA-48
+REP Repeat last graphic char ^[ [ b n
diff --git a/sys/teken/teken.h b/sys/teken/teken.h
index 0186fedb20d5..5ee2474ed455 100644
--- a/sys/teken/teken.h
+++ b/sys/teken/teken.h
@@ -157,6 +157,7 @@ struct __teken {
unsigned int t_utf8_left;
teken_char_t t_utf8_partial;
+ teken_char_t t_last;
unsigned int t_curscs;
teken_scs_t *t_saved_curscs;
diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h
index c69fe76bfb13..c9dfa4d9bb92 100644
--- a/sys/teken/teken_subr.h
+++ b/sys/teken/teken_subr.h
@@ -796,10 +796,11 @@ teken_subr_primary_device_attributes(const teken_t *t, unsigned int request)
}
static void
-teken_subr_do_putchar(const teken_t *t, const teken_pos_t *tp, teken_char_t c,
+teken_subr_do_putchar(teken_t *t, const teken_pos_t *tp, teken_char_t c,
int width)
{
+ t->t_last = c;
if (t->t_stateflags & TS_INSERT &&
tp->tp_col < t->t_winsize.tp_col - width) {
teken_rect_t ctr;
@@ -1332,3 +1333,12 @@ teken_subr_vertical_position_absolute(teken_t *t, unsigned int row)
t->t_stateflags &= ~TS_WRAPPED;
teken_funcs_cursor(t);
}
+
+static void
+teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts)
+{
+
+ for (; t->t_last != 0 && rpts > 0; rpts--)
+ teken_subr_regular_character(t, t->t_last);
+}
+