aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-03-13 09:15:32 +0100
committerBoris Faure <billiob@gmail.com>2018-03-13 09:15:32 +0100
commit9e0243d9f16f13b3bc2449b551aefd0d8a4da81e (patch)
treed300b24c295403ce28e01ca64eb2252344c898af
parentshift-selection: reduce timeout to 5s, seems enough. Ref T2254 (diff)
downloadterminology-9e0243d9f16f13b3bc2449b551aefd0d8a4da81e.tar.gz
support encircled escape code. Closes https://phab.enlightenment.org/T6769
-rw-r--r--src/bin/termpty.h7
-rw-r--r--src/bin/termptyesc.c18
-rw-r--r--src/bin/termptygfx.c17
-rw-r--r--src/bin/termptyops.c3
-rwxr-xr-xtools/fonts.sh4
5 files changed, 47 insertions, 2 deletions
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 9ad1ad6..5cac261 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -64,11 +64,14 @@ struct _Termatt
unsigned short autowrapped : 1;
unsigned short newline : 1;
unsigned short fraktur : 1;
+ unsigned short framed : 1;
+ unsigned short encircled : 1;
+ unsigned short overlined : 1;
#if defined(SUPPORT_80_132_COLUMNS)
unsigned short is_80_132_mode_allowed : 1;
- unsigned short bit_padding : 14;
+ unsigned short bit_padding : 11;
#else
- unsigned short bit_padding : 15;
+ unsigned short bit_padding : 12;
#endif
};
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index b34250b..3cc4e20 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -847,6 +847,24 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr)
ty->termstate.att.bg = COL_DEF;
ty->termstate.att.bgintense = 0;
break;
+ case 51:
+ WRN("TODO: support SGR 51 - framed attribute");
+ ty->termstate.att.framed = 1;
+ break;
+ case 52:
+ ty->termstate.att.encircled = 1;
+ break;
+ case 53:
+ WRN("TODO: support SGR 51 - overlined attribute");
+ ty->termstate.att.overlined = 1;
+ break;
+ case 54:
+ ty->termstate.att.framed = 0;
+ ty->termstate.att.encircled = 0;
+ break;
+ case 55:
+ ty->termstate.att.overlined = 0;
+ break;
case 90: // fg
case 91:
case 92:
diff --git a/src/bin/termptygfx.c b/src/bin/termptygfx.c
index 79dee37..afb7115 100644
--- a/src/bin/termptygfx.c
+++ b/src/bin/termptygfx.c
@@ -60,5 +60,22 @@ _termpty_charset_trans(const Termpty *ty, Eina_Unicode g)
g += 0x1d504 - 'A';
}
}
+ else if (ty->termstate.att.encircled)
+ {
+ if (g >= 'a' && g <= 'z')
+ {
+ g += 0x24d0 - 'a';
+ }
+ else if (g >= 'A' && g <= 'Z')
+ {
+ g += 0x24b6 - 'A';
+ }
+ else if (g >= '1' && g <= '9')
+ {
+ g += 0x2460 - '0';
+ }
+ else if (g == '0')
+ g = 0x24ea;
+ }
return g;
}
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 068ac47..5c1465a 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -418,6 +418,9 @@ termpty_reset_att(Termatt *att)
att->autowrapped = 0;
att->newline = 0;
att->fraktur = 0;
+ att->framed = 0;
+ att->encircled = 0;
+ att->overlined = 0;
}
void
diff --git a/tools/fonts.sh b/tools/fonts.sh
index 917bab8..ef4b340 100755
--- a/tools/fonts.sh
+++ b/tools/fonts.sh
@@ -18,3 +18,7 @@ echo -ne "\033[3;1mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m"
echo -ne "\nfraktur\n"
echo -ne "\033[20mabcdefghijklmnopqrstuvwxyz\n\033[0m"
echo -ne "\033[20mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m"
+
+echo -ne "\nencircled\n"
+echo -ne "\033[52ma b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4\n\033[0m"
+echo -ne "\033[52mA B C D E F G H I J K L M N O P Q R S T U V W X Y Z 5 6 7 8 9\n\033[0m"