aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-06-08 20:09:40 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-06-08 20:09:40 +0000
commita2c9c56f1962ce02e71582c06f389e53d1869e90 (patch)
treeedccb2370b00eda003aa7a0f10bc1ff2df786e5c /terminal.c
parentvt: add support for LS2 and LS3 locking shifts (diff)
vt: fix SS2/SS3 escape sequences to act correctly as single shifts
These sequences are supposed to affect the next printable ASCII character and then reset to the previous character set, but before this commit they were behaving like locking shifts.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index 3d6c20d4..5ba7b854 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2839,6 +2839,14 @@ ascii_printer_fast(struct terminal *term, wchar_t wc)
xassert(!term->grid->cursor.lcf);
}
+static void
+ascii_printer_single_shift(struct terminal *term, wchar_t wc)
+{
+ ascii_printer_generic(term, wc);
+ term->charsets.selected = term->charsets.saved;
+ term_update_ascii_printer(term);
+}
+
void
term_update_ascii_printer(struct terminal *term)
{
@@ -2860,6 +2868,14 @@ term_update_ascii_printer(struct terminal *term)
term->ascii_printer = new_printer;
}
+void
+term_set_single_shift_ascii_printer(struct terminal *term, int selected)
+{
+ term->charsets.saved = term->charsets.selected;
+ term->charsets.selected = selected;
+ term->ascii_printer = &ascii_printer_single_shift;
+}
+
enum term_surface
term_surface_kind(const struct terminal *term, const struct wl_surface *surface)
{