Subject: Re: bug#57434: 28.1.91; Terminal Emacs Mac OS flickering.

From: Eli Zaretskii <[email-masked]>
Date: Thu, 08 Sep 2022 09:25:06 +0300

> From: Gerd Möllmann <[email-masked]>
> Cc: Dmitrii Kuragin <[email-masked]>,  [email-masked]
> Date: Thu, 08 Sep 2022 07:31:17 +0200
> 
> > So now the next question is: on what should we base the activation of
> > these hooks?  There are several alternatives:
> >
> >   . if alacritty produces a distinct value from tty-type, we could use
> >     that, or
> >   . if alacritty has a distinct terminfo capability that other
> >     terminals don't, we could use that, or
> >   . expose a variable to Lisp that users could set in order to turn
> >     this on and off, and tell users to turn it on if they see the
> >     issue
> >
> > Any other ideas?
> 
> I'd like to emphasize that this is not a problem limited to Alacritty.
> There are a number of terminal emulators with GPU accelleration, which
> all share the same cpmceptual problem. Alacritty is just the one with
> the best marketing, riding the Rust wave.
> 
> AFAICT, we have the following situation:
> 
>  - We have two proposals P1 and P2 (that we know of).  Alacritty
>    implements P1 only, says Dmitrii, and P2 has a table of emulators
>    implementing P2, which may or may not implement P1.
>    
>  - Neither P1 nor P2 are detectable as a terminfo capability, so one has
>    to match TERM or use a boolean switch.  I don't know if all emulators
>    use a discernable TERM, or if they use standard TERM names.

So you are saying at this point only my last alternative, i.e. a
variable exposed to Lisp, is a reasonable way ahead?  Until, that is,
those emulators get their act together and agree on some standard way
of detecting the need for synchronized updates?

> >> BTW, tmux uses the sync update for their own TUI and they check "Sync" terminal capability. Do we need to
> >> do the same or we can just send the escapes and hope the unsupported terminal would just recover?
> >
> > What is that Sync capability, what is its value for tmux, and how is
> > it supposed to be used?  Is there any documentation I could read about
> > that?
> 
> I know Sync as an xterm extension, although I don't remember what it is
> for.  It's a non-standard terminfo capability which is only shown with
> infocmp -x.
> 
> Neither P1 nor P2 mention Sync in any way.

Does terminfo return the Sync capability on those terminals, as it
returns the standard ones?  That is, can we test for it inside
init_tty?