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: Tue, 30 Aug 2022 09:19:42 -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> <83wnaqugvh.fsf@gnu.org> Reply-To: Dmitrii Kuragin Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001bd72205e777c010" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14397"; 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 Tue Aug 30 18:42:53 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 1oT4KC-0003ZC-Tu for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 18:42:53 +0200 Original-Received: from localhost ([::1]:33132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT4KB-0005AN-QI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 12:42:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT3z4-0005N1-J8 for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 12:21:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oT3z4-0002jk-5E for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 12:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oT3z3-0005E2-Lq for bug-gnu-emacs@gnu.org; Tue, 30 Aug 2022 12:21: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: Tue, 30 Aug 2022 16:21: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.166187640319961 (code B ref 57434); Tue, 30 Aug 2022 16:21:01 +0000 Original-Received: (at 57434) by debbugs.gnu.org; 30 Aug 2022 16:20:03 +0000 Original-Received: from localhost ([127.0.0.1]:37257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT3y6-0005Bq-Fq for submit@debbugs.gnu.org; Tue, 30 Aug 2022 12:20:03 -0400 Original-Received: from mail-yb1-f179.google.com ([209.85.219.179]:44553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oT3y4-0005BI-4J for 57434@debbugs.gnu.org; Tue, 30 Aug 2022 12:20:01 -0400 Original-Received: by mail-yb1-f179.google.com with SMTP id g5so258605ybg.11 for <57434@debbugs.gnu.org>; Tue, 30 Aug 2022 09:20:00 -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=RKy/5jUTmAJhFMsxPAPNcHj665o+jbM8TGMRhnJ8Sl0=; b=lzAAfO1D/5BoX1msGToTxtqQvVjFGaJ4YpcrTq70f7K5BFy8Qd+LuWnm8ZjBcPTOHx j+9pUW9KUPeWBn0tqVGJQ/4QwYfIaESw02cJ/rHjLgRVDSq6mTHL7iUGB5EBqdMGP5vI 5xK2coiYVB0KePFjs4IXNMRbhzf9KOjtYBEcK3FY61o0rz18sxqCsg6Wadq9V0ZqNHK7 kmA8dUjqWdd1i0aLd3u5fujrCrM9VNv3nVefAXc8sbD4LTTja+BvT7JF1snvZTvIJut4 nDvIdDYQZscJWvGn5C+WOfnddI6LWz718ZH+ZJwp6bYOjNCXs7d8h4i7OKKr/dtfHbZI k2yw== 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=RKy/5jUTmAJhFMsxPAPNcHj665o+jbM8TGMRhnJ8Sl0=; b=4srLJb9onTgTP25LWmyH0juCb+ETuR7/r6+SuXqiVIoH5PBJ3gi4hRBpDj3X//M2Bi f01dBPyaXUAQBQWx6z+MLyT47MUELPi1pbesnueKbukdkzaOMJ5mgkM0puzxZrMGNXUp J41rjO4Dds2lprWPocZM5+4KJFGjAs5tuRwIBpkQwdXOiuzGxLG3qQTmhgOdQTTIXvOM 80pm9pXxrpuy1vBWG14r8w5B7+IBu9bySymDuhScicvF7iqqEdQ0NTjd7d1GGE7fRt+U FjoXHYngybcD+CRfHl8C9l2ukeDo8bnBHURY3TbGyMB20WyxN8FtWPooqFIMECQ3rWjq KnwQ== X-Gm-Message-State: ACgBeo3+Nx0iMBBRcz/fsvoocyZapEug6waEuJauR6KGxM8mOiVQmWZh hGLQZAKKhVw1xka1BP12ddPnuB8zxOyUHfa1eIj6KA== X-Google-Smtp-Source: AA6agR7Du41QSJj1IEUauUyPl6Qgh+lWEvdOyZOpbFhv+MuVjmWceQD3ZrrDGKu+Zs6ozrAvNZh2igN/ERP8tEFMn9k= X-Received: by 2002:a25:c1c6:0:b0:66f:5acc:7fb8 with SMTP id r189-20020a25c1c6000000b0066f5acc7fb8mr12337076ybf.634.1661876393697; Tue, 30 Aug 2022 09:19:53 -0700 (PDT) In-Reply-To: <83wnaqugvh.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:241146 Archived-At: --0000000000001bd72205e777c010 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable `tty->TS_ins_line` (al) is supprted. `tty->TS_ins_multi_lines` (AL) is supprted. `tty->TS_del_line` (dl) is supprted. `tty->TS_del_multi_lines` (DL) is supprted. to verify that I used `tput `. I think, that is sufficient for `tty->line_ins_del_ok` to be true, but fo completeness: `tty->TS_fwd_scroll` (sf) is supprted. `tty->TS_rev_scroll` (sr) is supprted. `tty->TS_set_window` (wi) is NOT supprted. `tty->TS_set_scroll_region` (cs) is supprted. `tty->TS_set_scroll_region_1` (cS) is NOT supprted. BUt I do not know how to verify `tty->Wcm->cm_abs`. ``` tty->scroll_region_ok =3D (tty->Wcm->cm_abs && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1)); ``` ``` 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)); ``` BTW, here's a video with what I have with "-Q", it still flickers: https://drive.google.com/file/d/1Yq2QFWHR6CHkoM4buEokV6p3a1uOI8ao/view?usp= =3Dsharing On Tue, Aug 30, 2022 at 4:09 AM Eli Zaretskii wrote: > > From: Gerd M=C3=B6llmann > > Cc: Eli Zaretskii , 57434@debbugs.gnu.org > > Date: Tue, 30 Aug 2022 08:09:33 +0200 > > > > Dmitrii Kuragin writes: > > > > > 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 > > > ``` > > > > Same here. > > Thanks. > > But I'm quite confused by all of this, because you don't show all the > relevant capabilities, AFAICT. > > We have in term.c: > > tty->scroll_region_ok > =3D (tty->Wcm->cm_abs > && (tty->TS_set_window || tty->TS_set_scroll_region || > tty->TS_set_scroll_region_1)); > > 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)); > > Please try all of the relevant capabilities and tell me which ones are > supported and which aren't. (Please also mention both the capability > string and its term.c flag name, so that I shouldn't need to jump > back-and-forth in the source looking up each one to understand what it > means.) > > Then we have in dispnew.c: > > /* If we cannot insert/delete lines, it's no use trying it. */ > if (!FRAME_LINE_INS_DEL_OK (f)) > inhibit_id_p =3D 1; > [...] > /* Try doing i/d line, if not yet inhibited. */ > if (!inhibit_id_p && i < desired_matrix->nrows) > force_p |=3D scrolling (f); > > Which means that 'scrolling', and thus 'scrolling_1' (where the > problem happens) will not be called if the line_ins_del_ok flag is not > set. > > Furthermore, we have in scrolling_1: > > if (FRAME_SCROLL_REGION_OK (frame)) > { > calculate_direct_scrolling (frame, matrix, window_size, > unchanged_at_bottom, > draw_cost, old_draw_cost, > old_hash, new_hash, free_at_end); > do_direct_scrolling (frame, frame->current_matrix, > matrix, window_size, unchanged_at_top); > } > else > { > calculate_scrolling (frame, matrix, window_size, unchanged_at_botto= m, > draw_cost, old_hash, new_hash, > free_at_end); > do_scrolling (frame, > frame->current_matrix, matrix, window_size, > unchanged_at_top); > } > > which means do_direct_scrolling (which causes the problem) will not be > called if the terminal's scroll_region_ok flag is not set. > > So given all of this, can you tell whether Emacs does TRT here? That > is: > > . are all the capabilities that are supposed to be available for > these two flags are indeed available? > . do we need to check any additional capabilities, which are in fact > used in the problematic scenario, but not tested as part of > setting these two flags? > > Assuming that Emacs does TRT, i.e. sets the flags correctly and uses > only the capabilities that are conditions for the flags set, then the > next important question is: why doesn't Gerd see the flickering on a > very similar system and the same terminal emulator? Is it possible > that some other local software configuration on Dmitrii's machine > causes this, directly or indirectly? E.g., Dmitrii, do you have some > display-related software/driver that has some "optimization" features > turned on? If so, can you turn them off and try again? > > Thanks. > --=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. --0000000000001bd72205e777c010 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
`tty->TS_ins_line` (al) is supprted.
`tty->TS_= ins_multi_lines` (AL) is supprted.
`tty->TS_del_line` (dl) is supprte= d.
`tty->TS_del_multi_lines` (DL) is supprted.

to verify that= I used `tput <cap_name>`.

I think, that is sufficient for `tt= y->line_ins_del_ok` to be true, but fo completeness:

`tty->TS_= fwd_scroll` (sf) is supprted.
`tty->TS_rev_scroll` (sr) is supprted.=


`tty->TS_set_window` (wi) is NOT supprted.
`tty->TS_= set_scroll_region` (cs) is supprted.
`tty->TS_set_scroll_region_1` (= cS) is NOT supprted.

BUt I do not know how to verify `tty->Wcm-&= gt;cm_abs`.


```
tty->scroll_region_ok
=C2=A0 =C2=A0 =3D= (tty->Wcm->cm_abs
=C2=A0 =C2=A0 =C2=A0 =C2=A0&& (tty->= TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_regi= on_1));
```


```
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));
```

BTW, here's a = video with what I have with "-Q", it still flickers:=C2=A0https://drive.google.com/file/d/1Yq2QFWHR6CHkoM4buEokV6p3a1u= OI8ao/view?usp=3Dsharing

On Tue, Aug 30, 2022 at 4:09 AM Eli Zaret= skii <eliz@gnu.org= > wrote:
>= From: Gerd M=C3=B6llmann <gerd.moellmann@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,=C2=A0 57434@debbugs.gnu.org
> Date: Tue, 30 Aug 2022 08:09:33 +0200
>
> Dmitrii Kuragin <kuragin@google.com> writes:
>
> > 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
> > ```
>
> Same here.

Thanks.

But I'm quite confused by all of this, because you don't show all t= he
relevant capabilities, AFAICT.

We have in term.c:

=C2=A0 tty->scroll_region_ok
=C2=A0 =C2=A0 =3D (tty->Wcm->cm_abs
=C2=A0 =C2=A0 =C2=A0 =C2=A0&& (tty->TS_set_window || tty->TS_= set_scroll_region || tty->TS_set_scroll_region_1));

=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_d= el_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 &= amp;& tty->TS_rev_scroll));

Please try all of the relevant capabilities and tell me which ones are
supported and which aren't.=C2=A0 (Please also mention both the capabil= ity
string and its term.c flag name, so that I shouldn't need to jump
back-and-forth in the source looking up each one to understand what it
means.)

Then we have in dispnew.c:

=C2=A0 /* If we cannot insert/delete lines, it's no use trying it.=C2= =A0 */
=C2=A0 if (!FRAME_LINE_INS_DEL_OK (f))
=C2=A0 =C2=A0 inhibit_id_p =3D 1;
=C2=A0 [...]
=C2=A0 /* Try doing i/d line, if not yet inhibited.=C2=A0 */
=C2=A0 if (!inhibit_id_p && i < desired_matrix->nrows)
=C2=A0 =C2=A0 force_p |=3D scrolling (f);

Which means that 'scrolling', and thus 'scrolling_1' (where= the
problem happens) will not be called if the line_ins_del_ok flag is not
set.

Furthermore, we have in scrolling_1:

=C2=A0 if (FRAME_SCROLL_REGION_OK (frame))
=C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 calculate_direct_scrolling (frame, matrix, window_size= ,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unchanged_at_bottom,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 draw_cost, old_draw_cost,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 old_hash, new_hash, free_at_e= nd);
=C2=A0 =C2=A0 =C2=A0 do_direct_scrolling (frame, frame->current_matrix,<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0matrix, window_size, unchanged_at_top);
=C2=A0 =C2=A0 }
=C2=A0 else
=C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 calculate_scrolling (frame, matrix, window_size, uncha= nged_at_bottom,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0draw_cost, old_hash, new_hash,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0free_at_end);
=C2=A0 =C2=A0 =C2=A0 do_scrolling (frame,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame= ->current_matrix, matrix, window_size,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 uncha= nged_at_top);
=C2=A0 =C2=A0 }

which means do_direct_scrolling (which causes the problem) will not be
called if the terminal's scroll_region_ok flag is not set.

So given all of this, can you tell whether Emacs does TRT here?=C2=A0 That<= br> is:

=C2=A0 . are all the capabilities that are supposed to be available for
=C2=A0 =C2=A0 these two flags are indeed available?
=C2=A0 . do we need to check any additional capabilities, which are in fact=
=C2=A0 =C2=A0 used in the problematic scenario, but not tested as part of =C2=A0 =C2=A0 setting these two flags?

Assuming that Emacs does TRT, i.e. sets the flags correctly and uses
only the capabilities that are conditions for the flags set, then the
next important question is: why doesn't Gerd see the flickering on a very similar system and the same terminal emulator?=C2=A0 Is it possible that some other local software configuration on Dmitrii's machine
causes this, directly or indirectly?=C2=A0 E.g., Dmitrii, do you have some<= br> display-related software/driver that has some "optimization" feat= ures
turned on?=C2=A0 If so, can you turn them off and try again?

Thanks.


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

--0000000000001bd72205e777c010--