aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-04-25 17:35:46 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-04-25 17:35:46 +0000
commitf95d7d468492144d7d36c08ab1b08f13a076e3fc (patch)
treea2ee82a20e0e57295723c7a06ff76ac4826b0bee
parentMerge branch 'modify-bg-color-when-highlighted-text-has-same-fg-bg' (diff)
csi: add support for DECSET 2026, as an alternative to BSU/ESU sequences
See: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2#note_847720
-rw-r--r--CHANGELOG.md6
-rw-r--r--csi.c10
-rw-r--r--doc/foot-ctlseqs.7.scd3
-rw-r--r--terminal.h1
4 files changed, 20 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74d29d3a..99a64154 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,7 +27,13 @@
## Unreleased
+
### Added
+
+* Support for DECSET/DECRST 2026, as an alternative to the existing
+ "synchronized updates" DCS sequences
+ (https://codeberg.org/dnkl/foot/issues/459).
+
### Changed
* `generate-alt-random-writes.py --sixel`: width and height of emitted
diff --git a/csi.c b/csi.c
index ec83f81e..c5f5ccc0 100644
--- a/csi.c
+++ b/csi.c
@@ -557,6 +557,13 @@ decset_decrst(struct terminal *term, unsigned param, bool enable)
term->bracketed_paste = enable;
break;
+ case 2026:
+ if (enable)
+ term_enable_app_sync_updates(term);
+ else
+ term_disable_app_sync_updates(term);
+ break;
+
case 8452:
term->sixel.cursor_right_of_graphics = enable;
break;
@@ -623,6 +630,7 @@ decrqm(const struct terminal *term, unsigned param, bool *enabled)
case 1049: *enabled = term->grid == &term->alt; return true;
case 1079: *enabled = term->sixel.use_private_palette; return true;
case 2004: *enabled = term->bracketed_paste; return true;
+ case 2026: *enabled = term->render.app_sync_updates.enabled; return true;
case 8452: *enabled = term->sixel.cursor_right_of_graphics; return true;
case 27127: *enabled = term->modify_escape_key; return true;
case 737769: *enabled = term_ime_is_enabled(term); return true;
@@ -665,6 +673,7 @@ xtsave(struct terminal *term, unsigned param)
case 1049: term->xtsave.alt_screen = term->grid == &term->alt; break;
case 1070: term->xtsave.sixel_private_palette = term->sixel.use_private_palette; break;
case 2004: term->xtsave.bracketed_paste = term->bracketed_paste; break;
+ case 2026: term->xtsave.app_sync_updates = term->render.app_sync_updates.enabled; break;
case 8452: term->xtsave.sixel_cursor_right_of_graphics = term->sixel.cursor_right_of_graphics; break;
case 27127: term->xtsave.modify_escape_key = term->modify_escape_key; break;
case 737769: term->xtsave.ime = term_ime_is_enabled(term); break;
@@ -706,6 +715,7 @@ xtrestore(struct terminal *term, unsigned param)
case 1049: enable = term->xtsave.alt_screen; break;
case 1070: enable = term->xtsave.sixel_private_palette; break;
case 2004: enable = term->xtsave.bracketed_paste; break;
+ case 2026: enable = term->xtsave.app_sync_updates; break;
case 8452: enable = term->xtsave.sixel_cursor_right_of_graphics; break;
case 27127: enable = term->xtsave.modify_escape_key; break;
case 737769: enable = term->xtsave.ime; break;
diff --git a/doc/foot-ctlseqs.7.scd b/doc/foot-ctlseqs.7.scd
index 78f5dfc8..8755cbaa 100644
--- a/doc/foot-ctlseqs.7.scd
+++ b/doc/foot-ctlseqs.7.scd
@@ -319,6 +319,9 @@ that corresponds to one of the following modes:
| 2004
: xterm
: Wrap pasted text with start/end delimiters (bracketed paste mode)
+| 2026
+: terminal-wg
+: Application synchronized updates mode
| 8452
: xterm
: Position cursor to the right of sixels, instead of on the next line
diff --git a/terminal.h b/terminal.h
index d8b1bf31..72685101 100644
--- a/terminal.h
+++ b/terminal.h
@@ -369,6 +369,7 @@ struct terminal {
bool alt_screen:1;
bool modify_escape_key:1;
bool ime:1;
+ bool app_sync_updates:1;
bool sixel_scrolling:1;
bool sixel_private_palette:1;