@@ -45,14 +45,23 @@ def __init__(
4545 self ._keyboard_decoder = codecs .getincrementaldecoder ("UTF-8" )()
4646
4747 def probe_xtgettcap (self , timeout : float = 1.0 ) -> None :
48- """Probe terminal capabilities via XTGETTCAP and apply results.
48+ """
49+ Probe terminal capabilities via XTGETTCAP and apply results.
50+
51+ This allows to improved 'number_of_colors' detection, and, to "overlay" capabilities not
52+ found in jinxed terminfo database but detected by XTGETTCAP: 'blink', 'sitm', 'ritm',
53+ 'cvvis', 'Smulx', 'Setulc', 'Ms', the same way that blessed.Terminal() would have but we
54+ is_a_tty was detected False when we initialized it.
4955
50- Must be called after the remote connection is established and after kitty keyboard detection
51- to prevent interference. Uses ``force=True`` because blessed thought we were not a terminal
52- when first initialized .
56+ This method is not called or used by gambaterm-ssh or gambaterm-telnet, because the above
57+ capabilities are not used and kitty keyboard support pretty reliably suggests 24-bit color
58+ support. It is just here as a suggestion, and can be safely deleted .
5359 """
5460 self ._xtgettcap_cache = self ._Terminal__init__xtgettcap () # type: ignore[assignment]
5561 self .number_of_colors = self ._Terminal__init__color_capabilities () # type: ignore[assignment]
62+ if self ._xtgettcap_cache .supported and self .does_styling :
63+ self ._jinxed_term .overlay_capabilities (
64+ ** self ._xtgettcap_cache .make_jinxed_capabilities ())
5665
5766 @contextlib .contextmanager
5867 def raw (self ) -> Generator [None , None , None ]:
0 commit comments