7 Commits

Author SHA1 Message Date
Mitchell Hashimoto
ae987c68e0 terminfo: reset kbs back to ^?, clear high bit for encoding 2024-04-21 10:07:53 -07:00
Mitchell Hashimoto
631ac651ab terminfo: for XTGETTCAP, non-parameterized string values return encoded
Fixes #1699

See #1699 for a lot more research. I haven't found a definitive source
of this behavior but this appears to match most of the mainstream
terminals and xterm for the realistic terminfo entries we have and
I'm going to consider that good enough.

For non-parameterized string values in a terminfo, the XTGETTCAP result
should be the tcap encoded form. This means replacing characters such as
`\E` with their byte form of 0x1B, and control characters such as `^H`
with their actual character 0x08, and so on.

"Non-parameterized" is a bit weird, the comment in this commit explains
my best guess (thanks to some community help) of why this may be.

This commit does NOT handle all encodings, but it handles the encodings
we use and the encodings I could cross-check with other terminals. The
actual tcap encoding is much more complicated and I'm sure for specific
types of terminfo values our encoding is not correct. If and when those
come up we should fix them.
2024-04-20 20:34:49 -07:00
Mitchell Hashimoto
026484fea6 fix more comptime var leaks 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
4724e0dcb4 terminfo: numeric comptime buffer only needs to be 10 bytes 2023-09-27 14:35:22 -07:00
Mitchell Hashimoto
28329761a7 terminfo: xtgettcap map name should use the source name 2023-09-27 14:30:27 -07:00
Mitchell Hashimoto
a02378f969 terminfo: comptime map for xtgettcap results 2023-09-27 14:23:57 -07:00
Mitchell Hashimoto
3ec8ce8063 terminfo: basic Source structure and can encode 2023-06-23 19:22:16 -07:00