Commit 02da6534 authored by Egmont Koblinger's avatar Egmont Koblinger

emulation: Drop ISO-2022 support

https://bugzilla.gnome.org/show_bug.cgi?id=732586
parent 18d710a8
......@@ -29,15 +29,6 @@ lib_LTLIBRARIES = libvte-@VTE_API_MAJOR_VERSION@.@VTE_API_MINOR_VERSION@.la
EXTRA_libvte_@VTE_API_MAJOR_VERSION@_@VTE_API_MINOR_VERSION@_la_SOURCES = \
box_drawing_generate.sh \
marshal.list \
mkunitables.sh \
unitable.CNS11643 \
unitable.CP437 \
unitable.GB12345 \
unitable.GB2312 \
unitable.JIS0201 \
unitable.JIS0208 \
unitable.JIS0212 \
unitable.KSX1001 \
vteseq-n.gperf \
vteseq-n.c \
vtetypebuiltins.c.template \
......@@ -329,7 +320,7 @@ TEST_SH = \
$(NULL)
EXTRA_DIST += $(TEST_SH)
check_PROGRAMS = dumpkeys iso2022 reflect-text-view reflect-vte mev table xticker vteconv
check_PROGRAMS = dumpkeys reflect-text-view reflect-vte mev table xticker vteconv
TESTS = table vteconv $(TEST_SH)
reflect_text_view_CPPFLAGS = -DUSE_TEXT_VIEW $(AM_CPPFLAGS)
......@@ -372,33 +363,6 @@ interpret_LDADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS)
iso2022_SOURCES = \
buffer.h \
caps.c \
caps.h \
debug.c \
debug.h \
iso2022.c \
iso2022.h \
matcher.c \
matcher.h \
table.c \
table.h \
vteconv.c \
vteconv.h \
vtetree.c \
vtetree.h
iso2022_CPPFLAGS = \
-DISO2022_MAIN \
$(AM_CPPFLAGS)
iso2022_CFLAGS = \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(AM_CFLAGS)
iso2022_LDADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS)
slowcat_SOURCES = \
slowcat.c \
$(NULL)
......
......@@ -54,6 +54,8 @@ const char _vte_xterm_capability_strings[] =
ENTRY(VT, "vertical-tab")
ENTRY(FF, "form-feed")
ENTRY(CR, "carriage-return")
ENTRY(SO, "shift-out")
ENTRY(SI, "shift-in")
ENTRY(DEL, "backspace")
ENTRY(ESC " F", "7-bit-controls")
......@@ -73,8 +75,12 @@ const char _vte_xterm_capability_strings[] =
ENTRY(ESC "%%@", "default-character-set")
ENTRY(ESC "%%G", "utf-8-character-set")
ENTRY(ESC "(0", "alternate-character-set-start")
ENTRY(ESC "(B", "alternate-character-set-end")
ENTRY(ESC "(0", "designate-g0-line-drawing")
ENTRY(ESC "(A", "designate-g0-british")
ENTRY(ESC "(B", "designate-g0-plain")
ENTRY(ESC ")0", "designate-g1-line-drawing")
ENTRY(ESC ")A", "designate-g1-british")
ENTRY(ESC ")B", "designate-g1-plain")
ENTRY(ESC "7", "save-cursor")
ENTRY(ESC "8", "restore-cursor")
......
......@@ -72,7 +72,7 @@ main(int argc, char **argv)
matcher = _vte_matcher_new();
subst = _vte_iso2022_state_new(NULL, VTE_ISO2022_DEFAULT_UTF8_AMBIGUOUS_WIDTH, NULL, NULL);
subst = _vte_iso2022_state_new(NULL);
for (;;) {
l = read (infile, buf, sizeof (buf));
......@@ -107,9 +107,6 @@ main(int argc, char **argv)
if (tmp == NULL) {
gunichar c;
c = g_array_index(array, gunichar, i);
if (VTE_ISO2022_HAS_ENCODED_WIDTH(c)) {
c &= ~VTE_ISO2022_ENCODED_WIDTH_MASK;
}
if (c < 32) {
g_print("`^%c'\n", c + 64);
} else
......
This diff is collapsed.
......@@ -30,33 +30,15 @@
G_BEGIN_DECLS
struct _vte_iso2022_state;
typedef void (*_vte_iso2022_codeset_changed_cb_fn)(struct _vte_iso2022_state *,
gpointer);
struct _vte_iso2022_state *_vte_iso2022_state_new(const char *native_codeset,
int utf8_ambiguous_width,
_vte_iso2022_codeset_changed_cb_fn,
gpointer);
struct _vte_iso2022_state *_vte_iso2022_state_new(const char *native_codeset);
void _vte_iso2022_state_set_codeset(struct _vte_iso2022_state *state,
const char *codeset);
void _vte_iso2022_state_set_utf8_ambiguous_width(struct _vte_iso2022_state *state,
int utf8_ambiguous_width);
const char *_vte_iso2022_state_get_codeset(struct _vte_iso2022_state *state);
gsize _vte_iso2022_process(struct _vte_iso2022_state *state,
guchar *input, gsize length,
const guchar *input, gsize length,
GArray *gunichars);
gunichar _vte_iso2022_process_single(struct _vte_iso2022_state *state,
gunichar c, gunichar map);
void _vte_iso2022_state_free(struct _vte_iso2022_state *);
#define VTE_ISO2022_DEFAULT_UTF8_AMBIGUOUS_WIDTH 1
#define VTE_ISO2022_ENCODED_WIDTH_BIT_OFFSET 28
#define VTE_ISO2022_ENCODED_WIDTH_MASK (3 << VTE_ISO2022_ENCODED_WIDTH_BIT_OFFSET)
#define VTE_ISO2022_HAS_ENCODED_WIDTH(__c) (((__c) & VTE_ISO2022_ENCODED_WIDTH_MASK) != 0)
int _vte_iso2022_get_encoded_width(gunichar c);
int _vte_iso2022_unichar_width(struct _vte_iso2022_state *state,
gunichar c);
G_END_DECLS
#endif
......@@ -561,13 +561,10 @@ _vte_table_extract_string(GValueArray **array,
{
GValue value = {0,};
gunichar *ptr;
guint i;
ptr = g_new(gunichar, arginfo->length + 1);
for (i = 0; i < arginfo->length; i++) {
ptr[i] = arginfo->start[i] & ~VTE_ISO2022_ENCODED_WIDTH_MASK;
}
ptr[i] = '\0';
memcpy(ptr, arginfo->start, sizeof(gunichar) * arginfo->length);
ptr[arginfo->length] = '\0';
g_value_init(&value, G_TYPE_POINTER);
g_value_set_pointer(&value, ptr);
......
......@@ -108,6 +108,7 @@ G_BEGIN_DECLS
#define VTE_UPDATE_REPEAT_TIMEOUT 30
#define VTE_MAX_PROCESS_TIME 100
#define VTE_CELL_BBOX_SLACK 1
#define VTE_DEFAULT_UTF8_AMBIGUOUS_WIDTH 1
#define VTE_UTF8_BPC (6) /* Maximum number of bytes used per UTF-8 character */
......@@ -149,6 +150,12 @@ struct vte_match_regex {
} cursor;
};
typedef enum _VteCharacterReplacement {
VTE_CHARACTER_REPLACEMENT_NONE,
VTE_CHARACTER_REPLACEMENT_LINE_DRAWING,
VTE_CHARACTER_REPLACEMENT_BRITISH
} VteCharacterReplacement;
/* The terminal's keypad/cursor state. A terminal can either be using the
* normal keypad, or the "application" keypad. */
typedef enum _VteKeymode {
......@@ -213,7 +220,7 @@ struct _VteTerminalPrivate {
/* Input data queues. */
const char *encoding; /* the pty's encoding */
int iso2022_utf8_ambiguous_width;
int utf8_ambiguous_width;
struct _vte_iso2022_state *iso2022;
struct _vte_incoming_chunk{
struct _vte_incoming_chunk *next;
......@@ -265,7 +272,6 @@ struct _VteTerminalPrivate {
plus the current
fore/back with no
character data */
gboolean alternate_charset;
} normal_screen, alternate_screen, *screen;
/* Selection information. */
......@@ -293,7 +299,6 @@ struct _VteTerminalPrivate {
gboolean margin_bell;
guint bell_margin;
gboolean allow_bold;
gboolean nrc_mode;
gboolean deccolm_mode; /* DECCOLM allowed */
GHashTable *tabstops;
gboolean text_modified_flag;
......@@ -301,6 +306,8 @@ struct _VteTerminalPrivate {
gboolean text_deleted_flag;
gboolean rewrap_on_resize;
gboolean bracketed_paste_mode;
VteCharacterReplacement character_replacements[2]; /* charsets in the G0 and G1 slots */
VteCharacterReplacement *character_replacement; /* pointer to the active one */
/* Scrolling options. */
gboolean scroll_background;
......
......@@ -84,6 +84,7 @@ typedef gunichar wint_t;
#define WORD_CHAR_ASCII_PUNCT "-,.;/?%&#_=+@~"
static int _vte_unichar_width(gunichar c, int utf8_ambiguous_width);
static void vte_terminal_set_visibility (VteTerminal *terminal, GdkVisibilityState state);
static void vte_terminal_paste(VteTerminal *terminal, GdkAtom board);
static void vte_terminal_real_copy_clipboard(VteTerminal *terminal);
......@@ -187,6 +188,22 @@ static GTimer *process_timer;
static const GtkBorder default_padding = { 1, 1, 1, 1 };
static int
_vte_unichar_width(gunichar c, int utf8_ambiguous_width)
{
if (G_LIKELY (c < 0x80))
return 1;
if (G_UNLIKELY (g_unichar_iszerowidth (c)))
return 0;
if (G_UNLIKELY (g_unichar_iswide (c)))
return 2;
if (G_LIKELY (utf8_ambiguous_width == 1))
return 1;
if (G_UNLIKELY (g_unichar_iswide_cjk (c)))
return 2;
return 1;
}
/* process incoming data without copying */
static struct _vte_incoming_chunk *free_chunks;
static struct _vte_incoming_chunk *
......@@ -620,7 +637,7 @@ vte_terminal_preedit_width(VteTerminal *terminal, gboolean left_only)
(!left_only || (i < terminal->pvt->im_preedit_cursor));
i++) {
c = g_utf8_get_char(preedit);
ret += _vte_iso2022_unichar_width(terminal->pvt->iso2022, c);
ret += _vte_unichar_width(c, terminal->pvt->utf8_ambiguous_width);
preedit = g_utf8_next_char(preedit);
}
}
......@@ -2070,9 +2087,6 @@ vte_terminal_get_encoding(VteTerminal *terminal)
* This setting controls whether ambiguous-width characters are narrow or wide
* when using the UTF-8 encoding (vte_terminal_set_encoding()). In all other encodings,
* the width of ambiguous-width characters is fixed.
*
* This setting only takes effect the next time the terminal is reset, either
* via escape sequence or with vte_terminal_reset().
*/
void
vte_terminal_set_cjk_ambiguous_width(VteTerminal *terminal, int width)
......@@ -2080,9 +2094,7 @@ vte_terminal_set_cjk_ambiguous_width(VteTerminal *terminal, int width)
g_return_if_fail(VTE_IS_TERMINAL(terminal));
g_return_if_fail(width == 1 || width == 2);
terminal->pvt->iso2022_utf8_ambiguous_width = width;
if (terminal->pvt->pty == NULL)
_vte_iso2022_state_set_utf8_ambiguous_width(terminal->pvt->iso2022, width);
terminal->pvt->utf8_ambiguous_width = width;
}
/**
......@@ -2098,7 +2110,7 @@ int
vte_terminal_get_cjk_ambiguous_width(VteTerminal *terminal)
{
g_return_val_if_fail(VTE_IS_TERMINAL(terminal), 1);
return terminal->pvt->iso2022_utf8_ambiguous_width;
return terminal->pvt->utf8_ambiguous_width;
}
static inline VteRowData *
......@@ -3031,28 +3043,57 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
VteScreen *screen;
gboolean line_wrapped = FALSE; /* cursor moved before char inserted */
/* DEC Special Character and Line Drawing Set. VT100 and higher (per XTerm docs). */
static gunichar line_drawing_map[31] = {
0x25c6, /* ` => diamond */
0x2592, /* a => checkerboard */
0x2409, /* b => HT symbol */
0x240c, /* c => FF symbol */
0x240d, /* d => CR symbol */
0x240a, /* e => LF symbol */
0x00b0, /* f => degree */
0x00b1, /* g => plus/minus */
0x2424, /* h => NL symbol */
0x240b, /* i => VT symbol */
0x2518, /* j => downright corner */
0x2510, /* k => upright corner */
0x250c, /* l => upleft corner */
0x2514, /* m => downleft corner */
0x253c, /* n => cross */
0x23ba, /* o => scan line 1/9 */
0x23bb, /* p => scan line 3/9 */
0x2500, /* q => horizontal line (also scan line 5/9) */
0x23bc, /* r => scan line 7/9 */
0x23bd, /* s => scan line 9/9 */
0x251c, /* t => left t */
0x2524, /* u => right t */
0x2534, /* v => bottom t */
0x252c, /* w => top t */
0x2502, /* x => vertical line */
0x2264, /* y => <= */
0x2265, /* z => >= */
0x03c0, /* { => pi */
0x2260, /* | => not equal */
0x00a3, /* } => pound currency sign */
0x00b7, /* ~ => bullet */
};
screen = terminal->pvt->screen;
insert |= screen->insert_mode;
invalidate_now |= insert;
/* If we've enabled the special drawing set, map the characters to
* Unicode. */
if (G_UNLIKELY (screen->alternate_charset)) {
_vte_debug_print(VTE_DEBUG_SUBSTITUTION,
"Attempting charset substitution"
"for U+%04X.\n", c);
/* See if there's a mapping for it. */
c = _vte_iso2022_process_single(terminal->pvt->iso2022, c, '0');
}
if (G_UNLIKELY (*terminal->pvt->character_replacement == VTE_CHARACTER_REPLACEMENT_LINE_DRAWING)) {
if (c >= 96 && c <= 126)
c = line_drawing_map[c - 96];
} else if (G_UNLIKELY (*terminal->pvt->character_replacement == VTE_CHARACTER_REPLACEMENT_BRITISH)) {
if (G_UNLIKELY (c == '#'))
c = 0x00a3; /* pound sign */
}
/* Figure out how many columns this character should occupy. */
if (G_UNLIKELY (VTE_ISO2022_HAS_ENCODED_WIDTH(c))) {
columns = _vte_iso2022_get_encoded_width(c);
c &= ~VTE_ISO2022_ENCODED_WIDTH_MASK;
} else {
columns = _vte_iso2022_unichar_width(terminal->pvt->iso2022, c);
}
columns = _vte_unichar_width(c, terminal->pvt->utf8_ambiguous_width);
/* If we're autowrapping here, do it. */
col = screen->cursor_current.col;
......@@ -3797,20 +3838,19 @@ skip_chunk:
}
}
_VTE_DEBUG_IF(VTE_DEBUG_PARSE) {
gunichar cc = c & ~VTE_ISO2022_ENCODED_WIDTH_MASK;
if (cc > 255) {
g_printerr("U+%04lx\n", (long) cc);
if (c > 255) {
g_printerr("U+%04lx\n", (long) c);
} else {
if (cc > 127) {
if (c > 127) {
g_printerr("%ld = ",
(long) cc);
(long) c);
}
if (cc < 32) {
if (c < 32) {
g_printerr("^%lc\n",
(wint_t)cc + 64);
(wint_t)c + 64);
} else {
g_printerr("`%lc'\n",
(wint_t)cc);
(wint_t)c);
}
}
}
......@@ -7905,12 +7945,6 @@ _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ..
g_free (str);
}
static void
_vte_terminal_codeset_changed_cb(struct _vte_iso2022_state *state, gpointer p)
{
vte_terminal_set_encoding(p, _vte_iso2022_state_get_codeset(state), NULL);
}
/* Initialize the terminal widget after the base widget stuff is initialized.
* We need to create a new psuedo-terminal pair, and set ourselves up to do
* the interpretation of sequences. */
......@@ -7965,17 +7999,19 @@ vte_terminal_init(VteTerminal *terminal)
pvt->screen = &terminal->pvt->normal_screen;
_vte_terminal_set_default_attributes(terminal);
/* Initialize charset modes. */
pvt->character_replacements[0] = VTE_CHARACTER_REPLACEMENT_NONE;
pvt->character_replacements[1] = VTE_CHARACTER_REPLACEMENT_NONE;
pvt->character_replacement = &pvt->character_replacements[0];
/* Set up the desired palette. */
vte_terminal_set_default_colors(terminal);
for (i = 0; i < VTE_PALETTE_SIZE; i++)
terminal->pvt->palette[i].sources[VTE_COLOR_SOURCE_ESCAPE].is_set = FALSE;
/* Set up I/O encodings. */
pvt->iso2022_utf8_ambiguous_width = VTE_ISO2022_DEFAULT_UTF8_AMBIGUOUS_WIDTH;
pvt->iso2022 = _vte_iso2022_state_new(pvt->encoding,
pvt->iso2022_utf8_ambiguous_width,
&_vte_terminal_codeset_changed_cb,
terminal);
pvt->utf8_ambiguous_width = VTE_DEFAULT_UTF8_AMBIGUOUS_WIDTH;
pvt->iso2022 = _vte_iso2022_state_new(pvt->encoding);
pvt->incoming = NULL;
pvt->pending = g_array_new(FALSE, TRUE, sizeof(gunichar));
pvt->max_input_bytes = VTE_MAX_INPUT_READ;
......@@ -8014,7 +8050,6 @@ vte_terminal_init(VteTerminal *terminal)
pvt->audible_bell = TRUE;
pvt->bell_margin = 10;
pvt->allow_bold = TRUE;
pvt->nrc_mode = TRUE;
pvt->deccolm_mode = FALSE;
pvt->rewrap_on_resize = TRUE;
vte_terminal_set_default_tabstops(terminal);
......@@ -9676,8 +9711,8 @@ vte_terminal_paint_im_preedit_string(VteTerminal *terminal)
items = g_new(struct _vte_draw_text_request, len);
for (i = columns = 0; i < len; i++) {
items[i].c = g_utf8_get_char(preedit);
items[i].columns = _vte_iso2022_unichar_width(terminal->pvt->iso2022,
items[i].c);
items[i].columns = _vte_unichar_width(items[i].c,
terminal->pvt->utf8_ambiguous_width);
items[i].x = (col + columns) * width;
items[i].y = row * height;
columns += items[i].columns;
......@@ -10771,7 +10806,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
(gobject_class,
PROP_CJK_AMBIGUOUS_WIDTH,
g_param_spec_int ("cjk-ambiguous-width", NULL, NULL,
1, 2, VTE_ISO2022_DEFAULT_UTF8_AMBIGUOUS_WIDTH,
1, 2, VTE_DEFAULT_UTF8_AMBIGUOUS_WIDTH,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
/**
......@@ -11733,10 +11768,7 @@ vte_terminal_reset(VteTerminal *terminal,
_vte_byte_array_clear(pvt->outgoing);
/* Reset charset substitution state. */
_vte_iso2022_state_free(pvt->iso2022);
pvt->iso2022 = _vte_iso2022_state_new(NULL,
pvt->iso2022_utf8_ambiguous_width,
&_vte_terminal_codeset_changed_cb,
terminal);
pvt->iso2022 = _vte_iso2022_state_new(NULL);
_vte_iso2022_state_set_codeset(pvt->iso2022,
pvt->encoding);
/* Reset keypad/cursor key modes. */
......@@ -11748,8 +11780,6 @@ vte_terminal_reset(VteTerminal *terminal,
pvt->meta_sends_escape = TRUE;
/* Disable margin bell. */
pvt->margin_bell = FALSE;
/* Enable iso2022/NRC processing. */
pvt->nrc_mode = TRUE;
/* Disable DECCOLM mode. */
pvt->deccolm_mode = FALSE;
/* Reset saved settings. */
......@@ -11766,9 +11796,10 @@ vte_terminal_reset(VteTerminal *terminal,
_vte_terminal_set_default_attributes(terminal);
pvt->screen = &pvt->normal_screen;
_vte_terminal_set_default_attributes(terminal);
/* Reset alternate charset mode. */
pvt->normal_screen.alternate_charset = FALSE;
pvt->alternate_screen.alternate_charset = FALSE;
/* Reset charset modes. */
pvt->character_replacements[0] = VTE_CHARACTER_REPLACEMENT_NONE;
pvt->character_replacements[1] = VTE_CHARACTER_REPLACEMENT_NONE;
pvt->character_replacement = &pvt->character_replacements[0];
/* Clear the scrollback buffers and reset the cursors. */
if (clear_history) {
_vte_ring_fini(pvt->normal_screen.row_data);
......
......@@ -118,8 +118,14 @@ struct vteseq_n_struct {
#"ansi-conformance-level-1", VTE_SEQUENCE_HANDLER_NULL
#"ansi-conformance-level-2", VTE_SEQUENCE_HANDLER_NULL
#"ansi-conformance-level-3", VTE_SEQUENCE_HANDLER_NULL
"alternate-character-set-start", VTE_SEQUENCE_HANDLER(vte_sequence_handler_alternate_character_set_start)
"alternate-character-set-end", VTE_SEQUENCE_HANDLER(vte_sequence_handler_alternate_character_set_end)
"designate-g0-plain", VTE_SEQUENCE_HANDLER(vte_sequence_handler_designate_g0_plain)
"designate-g0-line-drawing", VTE_SEQUENCE_HANDLER(vte_sequence_handler_designate_g0_line_drawing)
"designate-g0-british", VTE_SEQUENCE_HANDLER(vte_sequence_handler_designate_g0_british)
"designate-g1-plain", VTE_SEQUENCE_HANDLER(vte_sequence_handler_designate_g1_plain)
"designate-g1-line-drawing", VTE_SEQUENCE_HANDLER(vte_sequence_handler_designate_g1_line_drawing)
"designate-g1-british", VTE_SEQUENCE_HANDLER(vte_sequence_handler_designate_g1_british)
"shift-in", VTE_SEQUENCE_HANDLER(vte_sequence_handler_shift_in)
"shift-out", VTE_SEQUENCE_HANDLER(vte_sequence_handler_shift_out)
"change-background-color-bel", VTE_SEQUENCE_HANDLER(vte_sequence_handler_change_background_color_bel)
"change-background-color-st", VTE_SEQUENCE_HANDLER(vte_sequence_handler_change_background_color_st)
"reset-background-color", VTE_SEQUENCE_HANDLER(vte_sequence_handler_reset_background_color)
......
......@@ -633,10 +633,6 @@ vte_sequence_handler_decset_internal(VteTerminal *terminal,
NULL, NULL,},
/* 41: more(1) fix. */
/* 42: Enable NLS replacements. */
{42, PRIV_OFFSET(nrc_mode), 0, 0,
FALSE,
TRUE,
NULL, NULL,},
/* 44: Margin bell. */
{44, PRIV_OFFSET(margin_bell), 0, 0,
FALSE,
......@@ -890,18 +886,60 @@ vte_sequence_handler_decset_internal(VteTerminal *terminal,
/* THE HANDLERS */
/* End alternate character set. */
/* G0 character set is a pass-thru (no mapping). */
static void
vte_sequence_handler_designate_g0_plain (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->character_replacements[0] = VTE_CHARACTER_REPLACEMENT_NONE;
}
/* G0 character set is DEC Special Character and Line Drawing Set. */
static void
vte_sequence_handler_designate_g0_line_drawing (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->character_replacements[0] = VTE_CHARACTER_REPLACEMENT_LINE_DRAWING;
}
/* G0 character set is British (# is converted to £). */
static void
vte_sequence_handler_designate_g0_british (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->character_replacements[0] = VTE_CHARACTER_REPLACEMENT_BRITISH;
}
/* G1 character set is a pass-thru (no mapping). */
static void
vte_sequence_handler_designate_g1_plain (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->character_replacements[1] = VTE_CHARACTER_REPLACEMENT_NONE;
}
/* G1 character set is DEC Special Character and Line Drawing Set. */
static void
vte_sequence_handler_designate_g1_line_drawing (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->character_replacements[1] = VTE_CHARACTER_REPLACEMENT_LINE_DRAWING;
}
/* G1 character set is British (# is converted to £). */
static void
vte_sequence_handler_designate_g1_british (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->character_replacements[1] = VTE_CHARACTER_REPLACEMENT_BRITISH;
}
/* SI (shift in): switch to G0 character set. */
static void
vte_sequence_handler_alternate_character_set_end (VteTerminal *terminal, GValueArray *params)
vte_sequence_handler_shift_in (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->screen->alternate_charset = FALSE;
terminal->pvt->character_replacement = &terminal->pvt->character_replacements[0];
}
/* Start using alternate character set. */
/* SO (shift out): switch to G1 character set. */
static void
vte_sequence_handler_alternate_character_set_start (VteTerminal *terminal, GValueArray *params)
vte_sequence_handler_shift_out (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->screen->alternate_charset = TRUE;
terminal->pvt->character_replacement = &terminal->pvt->character_replacements[1];
}
/* Beep. */
......@@ -2160,7 +2198,7 @@ static void
vte_sequence_handler_send_primary_device_attributes (VteTerminal *terminal, GValueArray *params)
{
/* Claim to be a VT220 with only national character set support. */
vte_terminal_feed_child(terminal, "\e[?62;9;c", -1);
vte_terminal_feed_child(terminal, "\e[?62;c", -1);
}
/* Send terminal ID. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment