From cc55c04034848de703ad5c4f094e66051094eb9d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 Dec 2025 18:22:42 +0530 Subject: [PATCH] Support XTGETTCAP query with key query-os[-_]name Fixes #9217 --- kitty/terminfo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kitty/terminfo.py b/kitty/terminfo.py index 9d84b5913..622046dfb 100644 --- a/kitty/terminfo.py +++ b/kitty/terminfo.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # License: GPL v3 Copyright: 2016, Kovid Goyal +import os import re from binascii import hexlify, unhexlify from collections.abc import Generator @@ -548,6 +549,9 @@ def get_capabilities(query_string: str, opts: 'Options', window_id: int = 0, os_ yield result(encoded_query_name) else: yield result(encoded_query_name, rval) + elif name in ('query-os-name', 'query-os_name'): + # https://github.com/kovidgoyal/kitty/issues/9217 + yield result(encoded_query_name, os.uname().sysname) else: if name in bool_capabilities: yield result(encoded_query_name, True)