unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitrii Kuragin via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 57434@debbugs.gnu.org
Subject: bug#57434: 28.1.91; Terminal Emacs Mac OS flickering.
Date: Wed, 7 Sep 2022 09:11:32 -0700	[thread overview]
Message-ID: <CALqSXk7EydR3eh+92TuzW2Y-G0QB3XnURBf8DYidwvzNj5qi8w@mail.gmail.com> (raw)
In-Reply-To: <m2o7vrg4os.fsf@Mini.fritz.box>


[-- Attachment #1.1: Type: text/plain, Size: 2167 bytes --]

Hello,

Sorry I made you wait. I tried the patch (see attachments) and everything
worked perfectly. No flickering.

I tried to implement the second spec, but it didn't work (at least in
Alacritty). But, I can try to add support for both.

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?

Side note: I still have the issue when I run emacs inside of tmux, but it
is due to lack of support from tmux side. I created a bug and will try to
implement the functionality in tmux sooner or later. See
https://github.com/tmux/tmux/issues/3325 foe details. I assume, in the case
of tmux, the multiplexer just consumes the escape codes and doesn't send
them to the parent terminal.


On Tue, Sep 6, 2022 at 9:59 PM Gerd Möllmann <gerd.moellmann@gmail.com>
wrote:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
> > Dmitrii Kuragin <kuragin@google.com> writes:
> >
> >> Also, I tried to enable syncing and it works like a charm.
> >
> > So I take it that you fixed the problem that you originally reported
> > with Alacritty.
> >
> > Could you please show a diff of what you did?
> >
> > Also, did you try both synchronized update proposols?
> >
> > https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec
> >
> https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
> >
> > If you didn't try both, could you please do and report back?
> >
> >> The next problem is I need to configure tmux to somehow respect it.
> >
> > Sorry, can't help with that, I don't know tmux.
>
> Ping.
>


-- 
*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
<http://www.inc.com/john-boitnott/how-flexible-hours-can-create-a-better-work-life-balance.html>
.  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.

[-- Attachment #1.2: Type: text/html, Size: 4673 bytes --]

[-- Attachment #2: 0001-Implement-Synchrnized-Update-for-frame-rendering-in-.patch --]
[-- Type: application/octet-stream, Size: 1632 bytes --]

From df63c2616d99b8d9162c9c422c50dc3c8de65d25 Mon Sep 17 00:00:00 2001
From: Dmitrii Kuragin <kuragin@chromium.org>
Date: Sat, 3 Sep 2022 09:30:48 -0700
Subject: [PATCH] Implement Synchrnized Update for frame rendering in TTY.

Spec: https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec

* src/term.c (set_tty_hooks, tty_update_end, tty_update_begin): Put
  escape sequence at the beginning and end of the fram update in order
  to inform terminal about synchonization points.
---
 src/term.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/term.c b/src/term.c
index 2e43d89232..5f7c07b2cf 100644
--- a/src/term.c
+++ b/src/term.c
@@ -227,6 +227,14 @@ tty_reset_terminal_modes (struct terminal *terminal)
     }
 }
 
+static void
+tty_update_begin (struct frame *f)
+{
+  struct tty_display_info *tty = FRAME_TTY (f);
+
+  fputs ("\033P=1s\033\\", tty->output);
+}
+
 /* Flag the end of a display update on a termcap terminal. */
 
 static void
@@ -238,6 +246,7 @@ tty_update_end (struct frame *f)
     tty_show_cursor (tty);
   tty_turn_off_insert (tty);
   tty_background_highlight (tty);
+  fputs ("\033P=2s\033\\", tty->output);
   fflush (tty->output);
 }
 
@@ -3880,6 +3889,7 @@ set_tty_hooks (struct terminal *terminal)
   terminal->ring_bell_hook = &tty_ring_bell;
   terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes;
   terminal->set_terminal_modes_hook = &tty_set_terminal_modes;
+  terminal->update_begin_hook = &tty_update_begin;
   terminal->update_end_hook = &tty_update_end;
 #ifdef MSDOS
   terminal->menu_show_hook = &x_menu_show;
-- 
2.37.2.789.g6183377224-goog


  reply	other threads:[~2022-09-07 16:11 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 16:54 bug#57434: 28.1.91; Terminal Emacs Mac OS flickering Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-27  5:34 ` Gerd Möllmann
2022-08-27  5:41   ` Gerd Möllmann
2022-08-27 15:03     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-27 15:46       ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-27 15:58         ` Eli Zaretskii
2022-08-27 16:01           ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-27 16:14             ` Eli Zaretskii
2022-08-29 14:18               ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 14:38                 ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 16:04                   ` Eli Zaretskii
2022-08-29 16:05                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 16:07                       ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 16:27                         ` Eli Zaretskii
2022-08-29 15:15                 ` Gerd Möllmann
2022-08-29 16:22                   ` Eli Zaretskii
2022-08-29 17:14                     ` Gerd Möllmann
2022-08-29 18:24                       ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 18:57                         ` Eli Zaretskii
2022-08-29 19:04                           ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 19:17                             ` Eli Zaretskii
2022-08-29 19:26                               ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 19:37                                 ` Eli Zaretskii
2022-08-29 20:25                                   ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 20:44                                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 21:08                                       ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-30 11:28                                         ` Eli Zaretskii
2022-08-30  6:09                                     ` Gerd Möllmann
2022-08-30 11:10                                       ` Eli Zaretskii
2022-08-30 11:23                                         ` Gerd Möllmann
2022-08-30 13:48                                           ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-30 16:19                                         ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-30 16:34                                           ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-30 17:00                                             ` Eli Zaretskii
2022-08-30 17:22                                               ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-30 11:11                                     ` Eli Zaretskii
2022-08-30  6:04                                   ` Gerd Möllmann
2022-08-30 11:46                                     ` Eli Zaretskii
2022-08-30 11:53                                       ` Gerd Möllmann
2022-08-30 12:07                                         ` Eli Zaretskii
2022-08-30 12:15                                           ` Gerd Möllmann
2022-08-30 12:48                                             ` Eli Zaretskii
2022-08-30 13:25                                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-30 13:48                                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-31  6:14                                       ` Gerd Möllmann
2022-08-31  6:14                                       ` Gerd Möllmann
2022-08-31  7:02                                         ` Gerd Möllmann
2022-08-31 11:09                                           ` Eli Zaretskii
2022-08-31 11:54                                             ` Gerd Möllmann
2022-08-31 14:12                                               ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-31 14:38                                                 ` Gerd Möllmann
2022-08-31 16:00                                                   ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-31 16:21                                                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-31 16:34                                                       ` Eli Zaretskii
2022-08-31 17:11                                                         ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-31 16:25                                                     ` Eli Zaretskii
2022-09-01  5:44                                                       ` Gerd Möllmann
2022-09-01  6:11                                                         ` Eli Zaretskii
2022-09-01  6:45                                                           ` Gerd Möllmann
2022-09-01  8:18                                                             ` Gerd Möllmann
2022-09-01  8:25                                                               ` Eli Zaretskii
2022-09-01  8:56                                                                 ` Gerd Möllmann
2022-09-01 11:30                                                                   ` Eli Zaretskii
2022-09-01 12:27                                                                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-01 12:32                                                                       ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-01 12:36                                                                         ` Gerd Möllmann
2022-09-02  7:16                                                         ` Eli Zaretskii
2022-09-02  7:26                                                           ` Eli Zaretskii
2022-09-02  9:21                                                             ` Gerd Möllmann
2022-09-03  8:04                                                               ` Gerd Möllmann
2022-09-03  9:06                                                                 ` Eli Zaretskii
2022-09-03 16:35                                                                   ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 16:51                                                                     ` Eli Zaretskii
2022-09-03 17:14                                                                       ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 17:21                                                                         ` Eli Zaretskii
2022-09-04  4:55                                                                         ` Gerd Möllmann
2022-09-07  4:59                                                                           ` Gerd Möllmann
2022-09-07 16:11                                                                             ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-07 18:17                                                                               ` Eli Zaretskii
2022-09-08  5:31                                                                                 ` Gerd Möllmann
2022-09-08  6:25                                                                                   ` Eli Zaretskii
2022-09-08  6:43                                                                                     ` Gerd Möllmann
2022-09-08  8:20                                                                                       ` Eli Zaretskii
2022-09-08  8:43                                                                                         ` Gerd Möllmann
2022-09-08  9:16                                                                                           ` Eli Zaretskii
2022-09-08  9:35                                                                                             ` Gerd Möllmann
2022-09-08 15:59                                                                                               ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-09 15:48                                                                                                 ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-09 16:00                                                                                                   ` Eli Zaretskii
2022-09-20 16:35                                                                                                     ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-20 16:45                                                                                                       ` Eli Zaretskii
2022-09-21  6:10                                                                                                         ` Gerd Möllmann
2022-09-21 11:17                                                                                                           ` Eli Zaretskii
2022-09-02  9:20                                                           ` Gerd Möllmann
2022-08-29 16:01                 ` Eli Zaretskii
2022-08-29 16:03                   ` Dmitrii Kuragin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-29 16:27                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALqSXk7EydR3eh+92TuzW2Y-G0QB3XnURBf8DYidwvzNj5qi8w@mail.gmail.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57434@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=kuragin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).