This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.


On Tue, 3 Mar 2020 12:14:00 +0100
Corinna Vinschen wrote:
> Btw., looking through the code with this change I wonder about ixput not
> being set to 0 in sendOut, right after calling WriteConsoleA.  That
> would drop the need to call empty after calls to sendOut and thus clean
> up the code, no?

This sounds reasonable. However, for the current console code,
most of wpixput = 0 can not be omitted by this.

For example,
          else if (*src == '7')         /* DECSC Save cursor position */
            {
              if (con.screen_alternated)
                {
                  /* For xterm mode only */
                  DWORD n;
                  /* Just send the sequence */
                  wpbuf_put (*src);
                  WriteConsoleA (get_output_handle (), wpbuf, wpixput, &n, 0);
                }
              else
                cursor_get (&con.savex, &con.savey);
              con.state = normal;
              wpixput = 0;  // <--- This can not be omitted.
            }

This can drop only two wpixput = 0.

                  /* Substitute "CSI Ps T" */
                  wpbuf_put ('[');
                  wpbuf_put ('T');
                }
              else
                wpbuf_put (*src);
              WriteConsoleA (get_output_handle (), wpbuf, wpixput, &n, 0);
              con.state = normal;
              wpixput = 0; // <--- Here
[...]
              /* ESC sequences below (e.g. OSC, etc) are left to xterm
                 emulation in xterm compatible mode, therefore, are not
                 handled and just sent them. */
              wpbuf_put (*src);
              /* Just send the sequence */
              DWORD n;
              WriteConsoleA (get_output_handle (), wpbuf, wpixput, &n, 0);
              con.state = normal;
              wpixput = 0; // <--- Here

So, this might not be worth much...

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]