From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitrii Kuragin via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57434: 28.1.91; Terminal Emacs Mac OS flickering. Date: Mon, 29 Aug 2022 12:26:07 -0700 Message-ID: References: <83edx1znjl.fsf@gnu.org> <83czclzms4.fsf@gnu.org> <83ler7vx3o.fsf@gnu.org> <838rn6x4h2.fsf@gnu.org> <834jxux3kd.fsf@gnu.org> Reply-To: Dmitrii Kuragin Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f16df405e7663c8c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30027"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , 57434@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 29 21:27:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oSkPf-0007dl-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 21:27:11 +0200 Original-Received: from localhost ([::1]:36490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSkPe-00058P-AM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 15:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSkPW-000580-QY for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 15:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSkPW-00075U-6J for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 15:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSkPV-0003pm-MV for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 15:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitrii Kuragin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Aug 2022 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57434 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57434-submit@debbugs.gnu.org id=B57434.166180118614697 (code B ref 57434); Mon, 29 Aug 2022 19:27:01 +0000 Original-Received: (at 57434) by debbugs.gnu.org; 29 Aug 2022 19:26:26 +0000 Original-Received: from localhost ([127.0.0.1]:33871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSkOw-0003oz-2J for submit@debbugs.gnu.org; Mon, 29 Aug 2022 15:26:26 -0400 Original-Received: from mail-yw1-f182.google.com ([209.85.128.182]:33499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSkOu-0003ol-DP for 57434@debbugs.gnu.org; Mon, 29 Aug 2022 15:26:25 -0400 Original-Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-32a09b909f6so221835097b3.0 for <57434@debbugs.gnu.org>; Mon, 29 Aug 2022 12:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ltSahhv/YfJreO+2yavsa7DdfrL3KoA5L0rd3Y0qGCc=; b=kFEIhcdncNjY74LlNYWPzg1XUThOmyhogdcui3WqJBuzYi+zXM2TEJLnjfo5mZ2Qpi i5HeaIZZ+6ZQylLF+pOaZDYQRUwXr/MmjesSBQFdfa8/2GtpYHxYrCD5X70QJ31U8dYR zSlJCxJ5XCsDnwOZ0obBxmw8Db6xgi6CjPcddhdXqf+ojJPumExfefgO+qSB0FOcX+X1 LJQMiJSO12yl4Txlqyg0WMAExwLpdMTY7Kb/FqBU+V7804si6jAWdVn9skEpmRvsl4rk LTSE8oXm6E453z0AQMX360sKfvRynzIUa6HFUEZkju4kQzxf5ZMjMh8cQP/wf+tGk7M2 z6FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ltSahhv/YfJreO+2yavsa7DdfrL3KoA5L0rd3Y0qGCc=; b=f9c507vvpXm5qdFMnYrRAHO1T37qj476tw2NdsV8PUVlbgzuBwKf3R9GJSfMDn/YSC OD9+i0eGxzNzo54+FsH8y1H7E9M+iFrmE43FjOZeYSf7Ez4pGfZA4KM1M9rjc094YSBP rrdtTlddv4uWE49X7xIgeGi3evEvd2/n+rGX/bCrDg5iK6GiS38md15t7ausNze7DFlP kynpszZx6UNDX2JYYMmLU2nlP4xjWhZK77TRDIrp1UMWyDt/HQ08F+U6jqhY0dCktXQb CajNPhicXotZXKzSTmr+EAVvDEQJlMbDbcDJsajgE30YPt0EAkCoeKxH2IIhx0iUZwal 7baw== X-Gm-Message-State: ACgBeo1EwLVf3aRZCdKpZGhtEkDW9y1m+DcGhyzYUVvA9iZrOjqRPT6F xu081swpkRklqMFSYvrsmXwJ/+edALzwoYsXbcYS5w== X-Google-Smtp-Source: AA6agR4xR2wCVP84ekjhQsh+a68EkCorZ+I3tCiUnoU1EMKh5qlMA3jKT7bpwL3j8zp7EXPhWnFSHBFCkw2JNOdSIkg= X-Received: by 2002:a05:6902:15cf:b0:67c:1ee7:149 with SMTP id l15-20020a05690215cf00b0067c1ee70149mr9470523ybu.594.1661801178659; Mon, 29 Aug 2022 12:26:18 -0700 (PDT) In-Reply-To: <834jxux3kd.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241065 Archived-At: --000000000000f16df405e7663c8c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I tried different terminal emulators, Alacritty, iTerm2, Terminal.app (stock). All of them show the same issue. So, it is not a terminal emulator= . Additional info: When the screen flickers I alway see only 2 rectangles w/o content and they always are the same for the same scroll position. Looking into the debugger, it corresponds to the same number of insertions and insert positions. The more heavy content on the screen the more frequently the regions w/o get visible. As an option, we can add the optional flag where we can entirely disable the optimization and probably let people test it on their setups. One more possible cause is 24 bit colors in my terminal: https://github.com/syl20bnr/spacemacs/wiki/Terminal But, even when I run emacs using 256 colors: ``` echo $TERM xterm-256color ``` But, It still shows the same issue. I am open to any possible solution. What would you like me to do? :) On Mon, Aug 29, 2022 at 12:16 PM Eli Zaretskii wrote: > > From: Dmitrii Kuragin > > Date: Mon, 29 Aug 2022 12:04:38 -0700 > > Cc: Gerd M=C3=B6llmann , > > 57434@debbugs.gnu.org > > > > More generally, we need to understand why insertion cause flickering > > whereas writing to the terminal does not. > > > > I agree. > > > > Let's ignore what I said about flushing. My assumption was that we draw > the terminal content in multiple steps > > in different places. For example, we remove some lines, then do some > logic, then we draw chars on top of it. > > So, if we have a lag between the operations and the terminal refreshes > the screen we see only part of the > > content. But, as I said. Let's ignore that and if you have any guidance > on how I can debug it further, it would be > > awesome. > > > > Flickering is consistent for some specific area. If I scroll between 2 > lines, back-and-forth Emacs flickers > > consistently. > > > > What would be my next steps to give more debug information? > > Can you try some other terminal emulator? I'm interested to know > whether all of them flicker, or just some. > > Another idea is to disable the insert/delete optimization entirely, by > making sure the line_ins_del_ok flag of the terminal is reset. The > question, of course, is what to base this on -- could be macOS or just > some specific terminal type. > --=20 *If you get an email from me outside of the 9-5 it is *not* because I'm always on or expect an immediate response from you; it is because of work flexibility . Evening and weekend emails are a sign I allocated some regular working hours for other things (such as family, gym, friends,...). And I encourage you to feel free to do the same. --000000000000f16df405e7663c8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I tried different terminal emulators, Alacritty, iTerm2= , Terminal.app (stock). All of them show the same issue. So, it is not a te= rminal emulator.

Additional=C2=A0info:
=
When the screen flickers I alway see= only 2 rectangles w/o content and they always are the same for the same sc= roll position.

Looking into the debugger, it corresponds to the same number o= f insertions and insert positions. The more heavy=C2=A0content on the scree= n the more frequently the regions w/o get visible.

As an option, we can add t= he optional flag where we can entirely disable the optimization and probabl= y let people test it on their setups.

One more possible cause is 24 = bit colors in my terminal:=C2=A0https://github.com/syl20bnr/spacemac= s/wiki/Terminal

But, even when I run emacs using 256 colors:
```
echo $TERM
xterm-256color
```

Bu= t, It still shows the same issue.
I am open to any possible=C2=A0solution= . What would you like=C2=A0me to do? :)=C2=A0

On Mon, Aug = 29, 2022 at 12:16 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Dmitrii Kuragin <kuragin@google.com>
> Date: Mon, 29 Aug 2022 12:04:38 -0700
> Cc: Gerd M=C3=B6llmann <gerd.moellmann@gmail.com>,
>=C2=A0 =C2=A0 =C2=A0 =C2=A057434@debbugs.gnu.org
>
>=C2=A0 More generally, we need to understand why insertion cause flicke= ring
>=C2=A0 whereas writing to the terminal does not.
>
> I agree.
>
> Let's ignore what I said about flushing. My assumption was that we= draw the terminal content in multiple steps
> in different places. For example, we remove some lines, then do some l= ogic, then we draw chars on top of it.
> So, if we have a lag between the operations and the terminal refreshes= the screen we see only part of the
> content. But, as I said. Let's ignore that and if you have any gui= dance on how I can debug it further, it would be
> awesome.
>
> Flickering is consistent for some specific area. If I scroll between 2= lines, back-and-forth Emacs flickers
> consistently.
>
> What would be my next steps to give more debug information?

Can you try some other terminal emulator?=C2=A0 I'm interested to know<= br> whether all of them flicker, or just some.

Another idea is to disable the insert/delete optimization entirely, by
making sure the line_ins_del_ok flag of the terminal is reset.=C2=A0 The question, of course, is what to base this on -- could be macOS or just
some specific terminal type.


--
*If yo= u get an email from me outside of the 9-5 it is=C2=A0not=C2=A0becaus= e I'm always on or expect an immediate response from you; it is because= of=C2=A0work flexibility.=C2= =A0=C2=A0Evening and weekend emails= are a sign I allocated some regular working hours for other things (such a= s family, gym, friends,...).=C2=A0 And I encourage you to feel free to do t= he same.

--000000000000f16df405e7663c8c--