summaryrefslogtreecommitdiff
path: root/src/vteseq.cc
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2022-02-03 20:58:11 +0100
committerChristian Persch <chpe@src.gnome.org>2022-02-03 20:58:11 +0100
commit0718a9a7f9300b2526eddb0fc74e25eef34795ba (patch)
treeadd56678d416b65234809d90e4d99140f1a0c73e /src/vteseq.cc
parente78b08c09dc3972ed9415fa5b82d47080a7380ca (diff)
downloadvte-0718a9a7f9300b2526eddb0fc74e25eef34795ba.tar.gz
emulation: Support XTVERSION sequence
Diffstat (limited to 'src/vteseq.cc')
-rw-r--r--src/vteseq.cc32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 3945fcac..9efde087 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -69,6 +69,11 @@ enum {
VTE_SGR_COLOR_SPEC_LEGACY = 5
};
+inline constexpr int firmware_version() noexcept
+{
+ return (VTE_MAJOR_VERSION * 100 + VTE_MINOR_VERSION) * 100 + VTE_MICRO_VERSION;
+}
+
void
vte::parser::Sequence::print() const noexcept
{
@@ -2435,8 +2440,7 @@ Terminal::DA2(vte::parser::Sequence const& seq)
if (seq.collect1(0, 0) != 0)
return;
- int const version = (VTE_MAJOR_VERSION * 100 + VTE_MINOR_VERSION) * 100 + VTE_MICRO_VERSION;
- reply(seq, VTE_REPLY_DECDA2R, {65, version, 1});
+ reply(seq, VTE_REPLY_DECDA2R, {65, firmware_version(), 1});
}
void
@@ -9064,6 +9068,30 @@ Terminal::XTERM_STCAP(vte::parser::Sequence const& seq)
}
void
+Terminal::XTERM_VERSION(vte::parser::Sequence const& seq)
+{
+ /*
+ * XTERM_VERSION - xterm request version report
+ *
+ * Returns the xterm name and version as XTERM_DSR.
+ *
+ * Arguments:
+ * args[0]: select function
+ * 0: report xterm name and version
+ *
+ * Defaults:
+ * args[0]: no defaults
+ *
+ * References: XTERM
+ */
+
+ if (seq.collect1(0) != 0)
+ return;
+
+ reply(seq, VTE_REPLY_XTERM_DSR, {}, "VTE(%d)", firmware_version());
+}
+
+void
Terminal::XTERM_WM(vte::parser::Sequence const& seq)
{
/*