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 13:44:52 -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/alternative; boundary="0000000000008b407805e7675637" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25353"; 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 22:46:18 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 1oSleD-0006RG-Pc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 22:46:17 +0200 Original-Received: from localhost ([::1]:59644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSleC-0002V0-Iu for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 16:46:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSldy-0002Uq-Rr for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 16:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSldy-000306-J7 for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 16:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSldy-0005pm-6Z for bug-gnu-emacs@gnu.org; Mon, 29 Aug 2022 16:46:02 -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 20:46:02 +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.166180591122356 (code B ref 57434); Mon, 29 Aug 2022 20:46:02 +0000 Original-Received: (at 57434) by debbugs.gnu.org; 29 Aug 2022 20:45:11 +0000 Original-Received: from localhost ([127.0.0.1]:33999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSld8-0005oW-WF for submit@debbugs.gnu.org; Mon, 29 Aug 2022 16:45:11 -0400 Original-Received: from mail-yw1-f181.google.com ([209.85.128.181]:47095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSld7-0005oG-2h for 57434@debbugs.gnu.org; Mon, 29 Aug 2022 16:45:09 -0400 Original-Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-3413ad0640dso70270287b3.13 for <57434@debbugs.gnu.org>; Mon, 29 Aug 2022 13:45:09 -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=rCUo3dCFtpma1vIxFPcROAhJPc5F42HMc40oc0Tm0/M=; b=XuGvOvw5pp4mmR+U0X/2N/ymD4WggNi8qM7gWGgYTmFAqmVCdbDURkvH89507d4svl zGReruvDyaP4UdrrKMxhfpU3UVLcmOHLEnnbl0p+JKBq63+iLKs16OltnlOgBpdvCDJm 9jfkMNJgzJLyLR7KN3x2wfHgOtW4V/3hyZKWtaAv5rnrXI0FQDlAahC/zTPeyLybVc0f mnf+rfpnopJ+PaHh0vQ5mPFG69ELmRPBfUqwAgMOVbYNZPxvwi/5mCuxn+Uuj8QnA3rw UHsjpwa0IgnzNaz5UoFKSH6CsqW6n71pF2FpGMvRZbkReigE8LYYrtxXrJSJ2+RoZnp3 lOWg== 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=rCUo3dCFtpma1vIxFPcROAhJPc5F42HMc40oc0Tm0/M=; b=17iN9++AISCCq/0yVSzLQ7tX3Uj1j4T18BZZzwj2NYDemk3opevwEPUYVL2N/g02AZ +nkvfTQWEPgM1yz96Npd93DNcx81xba+kjpozwTf7YH/AaphiG4DESPE6VZxu4YVr/Kz Rn7IKIvTwDojkaBAJsdNAN+yClVFwbIp38iwPh4dZahKtYGjpbl/ehB67ZrIPcFpEn9O 2R91AZI0WDccz2VpZfYJbzjKCrAr8NI4g7p2QRKfEM45SkPh8ZUdAglsVz5bG2xTj2Tj KWQZ5qUsvUCmxp33ApYfYFnj+2nlFy1B1fDDwQcn+g568F67JEJBNWwsyVChqCYvhmKy y9yg== X-Gm-Message-State: ACgBeo0FPwKjJWQbaZiIYg48KJEXLnGuxWXG9mhrP8fw6shjW/bryLqe 02ay+IeksTTcAxlelpHkjKohbcfoFaxA6apyzDKAxw== X-Google-Smtp-Source: AA6agR4erUnoAieMmwmx9WTipujAnsnFZ7SzOwmzbNKj5rWqA2DDrPWHxIap3x4QdbBJ8seul4wYP5bDcHAOCRHdJn8= X-Received: by 2002:a81:b654:0:b0:33d:cd1a:3cf8 with SMTP id h20-20020a81b654000000b0033dcd1a3cf8mr11529184ywk.360.1661805903142; Mon, 29 Aug 2022 13:45:03 -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:241069 Archived-At: --0000000000008b407805e7675637 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 caused 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 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. --0000000000008b407805e7675637 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On my remote linux machine `line_is_del_ok` should be f= alse 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 fal= se and `tput sr` and `tput sf` are false ("unknown terminfo capability= ").=C2=A0

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 caused any troubles.

So, would it be ok to disab= le `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:
So far:
```
:~/Desktop% tput al; echo $?
0
:~/Desktop% tput AL; echo $?
= 1%dL0
:~/Desktop% tput dl; echo $?
0
:~/Desktop% tput DL; echo $?<= br>1%dM0
:~/Desktop% tput sf; echo $?

0
0~/Desktop% tput sr; e= cho $?
:~/Desktop% tput wi; echo $?
tput: unknown terminfo capability= 'wi'
4
:~/Desktop% tput cs; echo $?
%p1%d;%p2%dr0
:~/D= esktop% tput cS; echo $?
tput: unknown terminfo capability 'cS'<= br>4
```

Seems like Mac Os doesn't s= upport "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 Mon, Aug 29, 2022 at 1= 2: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 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.

--0000000000008b407805e7675637--