mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
dcs: xtgettcap: handle boolean capabilities
Reply with DCS 1 + r <cap> ST
This commit is contained in:
parent
7feab6092c
commit
44aad0941f
2 changed files with 13 additions and 4 deletions
|
|
@ -174,9 +174,6 @@ def main():
|
|||
'static const struct foot_terminfo_entry terminfo_capabilities[] = {\n')
|
||||
|
||||
for cap in sorted(entry.caps.values()):
|
||||
if isinstance(cap, BoolCapability):
|
||||
continue
|
||||
|
||||
name = cap.name
|
||||
value = str(cap.value)
|
||||
|
||||
|
|
@ -194,7 +191,11 @@ def main():
|
|||
# Do escape ‘“‘
|
||||
name = name.replace('"', '\"')
|
||||
value = value.replace('"', '\"')
|
||||
target.write(f' {{"{name}", "{value}"}},\n')
|
||||
|
||||
if isinstance(cap, BoolCapability):
|
||||
target.write(f' {{"{name}", NULL}},\n')
|
||||
else:
|
||||
target.write(f' {{"{name}", "{value}"}},\n')
|
||||
|
||||
target.write('};\n')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue