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

From: Gerd Möllmann <[email-masked]>
Date: Thu, 08 Sep 2022 07:31:17 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Dmitrii Kuragin <[email-masked]>
>> Date: Wed, 7 Sep 2022 09:11:32 -0700
>> Cc: Eli Zaretskii <[email-masked]>, [email-masked]
>> 
>> Sorry I made you wait. I tried the patch (see attachments) and everything worked perfectly. No flickering.
>
> OK, thanks.
>
> 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.

>
>> 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.