diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-07-27 16:54:25 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-07-27 16:54:25 +0000 |
| commit | a3db31d5cb62bb9afeb1c6cf3ee626abdf061009 (patch) | |
| tree | f23d5434f505b35b6a53e14673593ca95ea02349 /csi.c | |
| parent | meson/pkgbuild: bump to 1.4.2 (diff) | |
| parent | doc: foot.5: modifiers+keys are plural (diff) | |
Merge branch 'master' into releases/1.4
Diffstat (limited to 'csi.c')
| -rw-r--r-- | csi.c | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -13,10 +13,11 @@ #define LOG_ENABLE_DBG 0 #include "log.h" #include "grid.h" -#include "vt.h" #include "selection.h" #include "sixel.h" #include "util.h" +#include "version.h" +#include "vt.h" #define UNHANDLED() LOG_DBG("unhandled: %s", csi_as_string(term, final, -1)) #define UNHANDLED_SGR(idx) LOG_DBG("unhandled: %s", csi_as_string(term, 'm', idx)) @@ -373,8 +374,17 @@ csi_dispatch(struct terminal *term, uint8_t final) * - 22 ANSI color, e.g., VT525. * - 28 Rectangular editing. * - 29 ANSI text locator (i.e., DEC Locator mode). + * + * Note: we report ourselves as a VT220, mainly to be able + * to pass parameters, to indiciate we support sixel, and + * ANSI colors. + * + * The VT level must be synchronized with the secondary DA + * response. + * + * Note: tertiary DA responds with "FOOT". */ - const char *reply = "\033[?62;4;6;15;17;22c"; + const char *reply = "\033[?62;4;22c"; term_to_slave(term, reply, strlen(reply)); break; } @@ -1405,9 +1415,22 @@ csi_dispatch(struct terminal *term, uint8_t final) * xterm uses its version number. We use an xterm * version number too, since e.g. Emacs uses this to * determine level of support. + * + * We report ourselves as a VT220. This must be + * synchronized with the primary DA respons. + * + * Note: tertiary DA replies with "FOOT". */ - term_to_slave(term, "\033[>41;347;0c", 12); + static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99"); + static_assert(FOOT_MINOR < 100, "Minor version must not exceed 99"); + static_assert(FOOT_PATCH < 100, "Patch version must not exceed 99"); + + char reply[64]; + snprintf(reply, sizeof(reply), "\033[>1;%02u%02u%02u;0c", + FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH); + + term_to_slave(term, reply, strlen(reply)); break; case 'm': |
