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 14:08:04 -0700 Message-ID: References: <83edx1znjl.fsf@gnu.org> <83czclzms4.fsf@gnu.org> <83ler7vx3o.fsf@gnu.org> <838rn6x4h2.fsf@gnu.org> <834jxux3kd.fsf@gnu.org> <831qsyx2lr.fsf@gnu.org> Reply-To: Dmitrii Kuragin Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000082a72905e767a943" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22799"; 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 23:09:16 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 1oSm0S-0005q2-9X for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 23:09:16 +0200 Original-Received: from localhost ([::1]:46744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSm0R-0004kC-Cn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 17:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSm0E-0004h4-5l for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 17:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSm0D-0006Sw-SZ for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 17:09:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSm0D-0006R8-NP for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 17:09: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 21:09: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.166180730424698 (code B ref 57434); Mon, 29 Aug 2022 21:09:01 +0000 Original-Received: (at 57434) by debbugs.gnu.org; 29 Aug 2022 21:08:24 +0000 Original-Received: from localhost ([127.0.0.1]:34029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSlzb-0006QH-EP for submit@debbugs.gnu.org; Mon, 29 Aug 2022 17:08:23 -0400 Original-Received: from mail-yw1-f172.google.com ([209.85.128.172]:36418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSlzY-0006Q3-OE for 57434@debbugs.gnu.org; Mon, 29 Aug 2022 17:08:21 -0400 Original-Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-33dc345ad78so227191697b3.3 for <57434@debbugs.gnu.org>; Mon, 29 Aug 2022 14:08:20 -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=D/Cp9pannMEXutsHLquP7PMe+qDIAzV8X+PNsVU0Chs=; b=kaCf9yAjgZOIRlA939Qf5xrmpDni42s8bLpVYtN4YTW4NAlq4G8NxByKhLZ+d2tfj1 75VJO7itTL1NhMdkDb0wFGOZeNCC/mQiYxBIOhlNKzFo0czkbjq1DTjfj1dxbnMssxUT 1qL9nvXvVTwEWLEGcKK6KJ7RVNZsN4LZWJGATprb0ZDfeP5MF+UAkEzLUghASQ/yE89s TBatI7/9j/Q+ZsV4FlGuyDTsQbBrCfdHr3oQ83nrScCdrJQU03DwjBVZFAkUajn2dMtP Akob7vESz6ZGBFpxj76AK8IjYjfki8MQgC785Z8wTi4sz/dsNjpVtpmm+va5ZcYpwEiS LL3Q== 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=D/Cp9pannMEXutsHLquP7PMe+qDIAzV8X+PNsVU0Chs=; b=PWG8gDAhE/tulIcyJbbA6ACkhdlBCB9bQMdcS7lQmD2MYeqLNC5nOf7p/8QBbUPAmE K45LQ2NoqOBXj81h+DUjMMZN+1YKYoSsaidBljW6x9bBdzBjpb7Q0G6N/GIi8T8MIbol CF2IVvrq9BuTVI7W3HqCXR0Lok1dOg3QVrCyRIMwADF/O4VQJnYJS43K1M+fSpbaVVJM x0Z0xRLfbXR7+WTZgzyrFGyJur+0T20dCDrnGEivxeotliUQIyXo/hRkY2l6uTPUw4+x RSE9afJf3AIqcK6DuMfSt45k5KbX4OuVbPJiySZnhxGz3A71YF5VZlIA4VM1tfWlB9bS +wiw== X-Gm-Message-State: ACgBeo1JSnC5EjVC6V7zhymAgmJc6BI8Zh+h3IwcToAtxMDmr2Q1ca1i KtIXaywNxx+fpnmBekTuadN5CRSD7bxKgATCcu3Gig== X-Google-Smtp-Source: AA6agR7tEwr1xNupEZoi5e+XdSxbBNFl+dL5IbQCrCk0JpGwzMvKs64FXZhtU6eHKfNrLbIv9I4U29wSHXxJ41lLcmU= X-Received: by 2002:a25:8d0e:0:b0:696:489e:ab40 with SMTP id n14-20020a258d0e000000b00696489eab40mr9621747ybl.494.1661807295073; Mon, 29 Aug 2022 14:08:15 -0700 (PDT) In-Reply-To: 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:241070 Archived-At: --00000000000082a72905e767a943 Content-Type: multipart/alternative; boundary="00000000000082a72705e767a941" --00000000000082a72705e767a941 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Here's the patch. On Mon, Aug 29, 2022 at 1:44 PM Dmitrii Kuragin wrote: > On my remote linux machine `line_is_del_ok` should be false where > ``` > tty->line_ins_del_ok > =3D (((tty->TS_ins_line || tty->TS_ins_multi_lines) > && (tty->TS_del_line || tty->TS_del_multi_lines)) > || (tty->scroll_region_ok > && tty->TS_fwd_scroll && tty->TS_rev_scroll)); > ``` > because `tput al` and `tput AL` are both false and `tput sr` and `tput sf= ` > are false ("unknown terminfo capability"). > > So, disabling `line_ins_del_ok` on mac os would lead to the same > configuration I have on the linux. On the linux machine scroll never caus= ed > any troubles. > > So, would it be ok to disable `line_ins_del_ok` for Mac OS? I would send = a > patch if it's OK. > > On Mon, Aug 29, 2022 at 1:25 PM Dmitrii Kuragin > wrote: > >> So far: >> ``` >> :~/Desktop% tput al; echo $? >> 0 >> :~/Desktop% tput AL; echo $? >> 1%dL0 >> :~/Desktop% tput dl; echo $? >> 0 >> :~/Desktop% tput DL; echo $? >> 1%dM0 >> :~/Desktop% tput sf; echo $? >> >> 0 >> 0~/Desktop% tput sr; echo $? >> :~/Desktop% tput wi; echo $? >> tput: unknown terminfo capability 'wi' >> 4 >> :~/Desktop% tput cs; echo $? >> %p1%d;%p2%dr0 >> :~/Desktop% tput cS; echo $? >> tput: unknown terminfo capability 'cS' >> 4 >> ``` >> >> Seems like Mac Os doesn't support "wi", but the condition is still going >> to be true. >> >> ``` >> tty->line_ins_del_ok =3D 0; >> ``` >> >> make the emacs really smooth w/o any flickering. >> >> On Mon, Aug 29, 2022 at 12:37 PM Eli Zaretskii wrote: >> >>> > From: Dmitrii Kuragin >>> > Date: Mon, 29 Aug 2022 12:26:07 -0700 >>> > Cc: Gerd M=C3=B6llmann , >>> > 57434@debbugs.gnu.org >>> > >>> > I tried different terminal emulators, Alacritty, iTerm2, Terminal.app >>> (stock). All of them show the same issue. >>> > So, it is not a terminal emulator. >>> >>> If this happens with all terminal emulators on macOS, we should reset >>> the line_ins_del_ok flag for macOS. Look in term.c, where it is >>> initialized by consulting various terminfo features supported by the >>> terminal. If all the features it consults indeed work on macOS, then >>> simply say something like >>> >>> #ifdef DARWIN_OS >>> tty->line_ins_del_ok =3D 0; >>> #else >>> ... the current code... >>> #endif >>> >>> and see if the problem goes away. >>> >>> Gerd, do you see the same on your system? >>> >> >> >> -- >> *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 wor= k >> 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. >> >> > > -- > *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 encoura= ge > you to feel free to do the same. > > --=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. --00000000000082a72705e767a941 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here's the patch.

On Mon, Aug 29, 2022 at 1:44= PM Dmitrii Kuragin <kuragin@googl= e.com> wrote:
On my remote linux machine `line_is_del_ok` should= be false where
```
=C2=A0 tty->line_ins_del_ok
=C2=A0 =C2=A0 = =3D (((tty->TS_ins_line || tty->TS_ins_multi_lines)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 && (tty->TS_del_line || tty->TS_del_multi_lines= ))
=C2=A0 =C2=A0 =C2=A0 =C2=A0|| (tty->scroll_region_ok
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&& tty->TS_fwd_scroll && = tty->TS_rev_scroll));
```
because `tput al` and `tput AL` are both= false and `tput sr` and `tput sf` are false ("unknown terminfo capabi= lity").=C2=A0

So, disabling `line_ins_del_ok` on mac os would l= ead to the same configuration I have on the linux. On the linux machine scr= oll never caused any troubles.

So, would it be ok to d= isable `line_ins_del_ok` for Mac OS? I would send a patch if it's OK.

On Mon, Aug 29, 2022 at 1:25 PM Dmitrii Kuragin <kuragin@google.com> wrote:
<= /div>
= So far:
```
:~/Desktop% tput al; echo $?
0
:~/Desktop= % tput AL; echo $?
1%dL0
:~/Desktop% tput dl; echo $?
0
:~/Desk= top% tput DL; echo $?
1%dM0
:~/Desktop% tput sf; echo $?

0
= 0~/Desktop% tput sr; echo $?
:~/Desktop% tput wi; echo $?
tput: unkno= wn terminfo capability 'wi'
4
:~/Desktop% tput cs; echo $?%p1%d;%p2%dr0
:~/Desktop% tput cS; echo $?
tput: unknown terminfo ca= pability 'cS'
4
```

Seems like = Mac Os doesn't support "wi", but the condition is still going= to be true.

```
tty->line_ins_del_ok =3D 0;
= ```

make the emacs really smooth=C2=A0w/o any flickering.

On Mo= n, Aug 29, 2022 at 12:37 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Dmitrii Kuragin <kuragin@google.com>
> Date: Mon, 29 Aug 2022 12:26:07 -0700
> Cc: Gerd M=C3=B6llmann <gerd.moellmann@gmail.com>,
>=C2=A0 =C2=A0 =C2=A0 =C2=A057434@debbugs.gnu.org
>
> I tried different terminal emulators, Alacritty, iTerm2, Terminal.app = (stock). All of them show the same issue.
> So, it is not a terminal emulator.

If this happens with all terminal emulators on macOS, we should reset
the line_ins_del_ok flag for macOS.=C2=A0 Look in term.c, where it is
initialized by consulting various terminfo features supported by the
terminal.=C2=A0 If all the features it consults indeed work on macOS, then<= br> simply say something like

=C2=A0 #ifdef DARWIN_OS
=C2=A0 =C2=A0 tty->line_ins_del_ok =3D 0;
=C2=A0 #else
=C2=A0 ... the current code...
=C2=A0 #endif

and see if the problem goes away.

Gerd, do you see the same on your system?


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



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



--
*If you get an email from me outside of the 9-5 it is=C2= =A0not=C2=A0because I'm always on or expect an immediate respons= e from you; it is because of=C2=A0<= a href=3D"http://www.inc.com/john-boitnott/how-flexible-hours-can-create-a-= better-work-life-balance.html" style=3D"color:rgb(17,85,204)" target=3D"_bl= ank">work flexibility.=C2=A0=C2=A0= Evening and weekend emails are a sign I allocated some regular working hour= s for other things (such as family, gym, friends,...).=C2=A0 And I encourag= e you to feel free to do the same.

--00000000000082a72705e767a941-- --00000000000082a72905e767a943 Content-Type: application/octet-stream; name="0001-Fix-terminal-Emacs-flickering-during-scrolling-on-Ma.patch" Content-Disposition: attachment; filename="0001-Fix-terminal-Emacs-flickering-during-scrolling-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ogCisjaWZkZWYgREFSV0lOX09TCisgIC8qIE11bHRpbGluZSBvcHRpbWl6YXRpb24g Y2F1c2UgdGVybWluYWwgZmxpY2tlcmluZyBvbiBNYWMgT1MuCisgICAgIFNlZSAoQnVnIzU3NDM0 KSAqLworICB0dHktPmxpbmVfaW5zX2RlbF9vayA9IDA7CisjZWxzZQogICB0dHktPmxpbmVfaW5z X2RlbF9vawogICAgID0gKCgodHR5LT5UU19pbnNfbGluZSB8fCB0dHktPlRTX2luc19tdWx0aV9s aW5lcykKICAgICAgICAgJiYgKHR0eS0+VFNfZGVsX2xpbmUgfHwgdHR5LT5UU19kZWxfbXVsdGlf bGluZXMpKQogICAgICAgIHx8ICh0dHktPnNjcm9sbF9yZWdpb25fb2sKICAgICAgICAgICAgJiYg dHR5LT5UU19md2Rfc2Nyb2xsICYmIHR0eS0+VFNfcmV2X3Njcm9sbCkpOworI2VuZGlmCiAKICAg dHR5LT5jaGFyX2luc19kZWxfb2sKICAgICA9ICgodHR5LT5UU19pbnNfY2hhciB8fCB0dHktPlRT X2luc2VydF9tb2RlCi0tIAoyLjM3LjIuNjcyLmc5NDc2OWQwNmYwLWdvb2cKCg== --00000000000082a72905e767a943--