From 8dcd2ed3c92d5fcaca7da3d2669b7ed3bd510ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Sun, 20 May 2018 14:21:20 +0000 Subject: teken, vt(4): Parse the "Cursor style" escape sequence The escape sequence (e.g. `^[[2 q`) was unsupported before and the letter `q` was displayed as a typed character. The sequence is used by Neovim for instance. Now, it is properly parsed. However, it is ignored, so it won't change the cursor style. Because the escape sequence contains a space character, the `gensequences` script had to be modified to support that. In the `sequences` file, a space is represented as the string `SP`. --- sys/teken/gensequences | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sys/teken/gensequences') diff --git a/sys/teken/gensequences b/sys/teken/gensequences index e0fccd4c80a0..a18e7a12fe04 100644 --- a/sys/teken/gensequences +++ b/sys/teken/gensequences @@ -35,6 +35,15 @@ function die(msg) { function cchar(str) { if (str == "^[") return "\\x1B"; + if (str == "SP") + return " "; + + return str; +} + +function csequence(str) { + if (str == "SP") + return " "; return str; } @@ -57,7 +66,7 @@ while (getline > 0) { prefix = ""; l_prefix_name[""] = "teken_state_init"; for (i = 1; i < nsequences; i++) { - n = prefix sequence[i]; + n = prefix csequence(sequence[i]); l_prefix_parent[n] = prefix; l_prefix_suffix[n] = sequence[i]; if (!l_prefix_name[n]) -- cgit v1.2.3