From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 2C6F63857C7B; Sun, 20 Feb 2022 11:17:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C6F63857C7B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: console: Call fix_tab_position() only if having broken tabs. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 29d8a83008122106be99c2653537a848f00e82b5 X-Git-Newrev: fc26624377d2794c70e7464e83b7442a8bd3c705 Message-Id: <20220220111729.2C6F63857C7B@sourceware.org> Date: Sun, 20 Feb 2022 11:17:29 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2022 11:17:29 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dfc26624377d= 2794c70e7464e83b7442a8bd3c705 commit fc26624377d2794c70e7464e83b7442a8bd3c705 Author: Takashi Yano Date: Thu Feb 17 00:34:40 2022 +0900 Cygwin: console: Call fix_tab_position() only if having broken tabs. =20 - Calling fix_tab_position() is necessary in Windows 10 with xterm compatible mode enabled, because it has a problem that the tab positions will be broken when the window size is changed. Fortunately, this problem has been fixed in Windows 11. Therefore, with this patch, necessity of fix_tab_position() call is determined by referring to wincap.has_con_broken_tabs(), which is recently introduced. Diff: --- winsup/cygwin/fhandler_console.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_con= sole.cc index 1dfe8e0c7..03ec88804 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -286,7 +286,8 @@ fhandler_console::cons_master_thread (handle_set_t *p, = tty *ttyp) { con.scroll_region.Top =3D 0; con.scroll_region.Bottom =3D -1; - if (wincap.has_con_24bit_colors () && !con_is_legacy) + if (wincap.has_con_24bit_colors () && !con_is_legacy + && wincap.has_con_broken_tabs ()) fix_tab_position (p->output_handle); ttyp->kill_pgrp (SIGWINCH); } @@ -664,7 +665,8 @@ fhandler_console::send_winch_maybe () { con.scroll_region.Top =3D 0; con.scroll_region.Bottom =3D -1; - if (wincap.has_con_24bit_colors () && !con_is_legacy) + if (wincap.has_con_24bit_colors () && !con_is_legacy + && wincap.has_con_broken_tabs ()) fix_tab_position (get_output_handle ()); get_ttyp ()->kill_pgrp (SIGWINCH); return true; @@ -2321,7 +2323,7 @@ fhandler_console::char_command (char c) if (con.args[i] =3D=3D 1049) { con.screen_alternated =3D (c =3D=3D 'h'); - need_fix_tab_position =3D true; + need_fix_tab_position =3D wincap.has_con_broken_tabs (); } if (con.args[i] =3D=3D 1) /* DECCKM */ con.cursor_key_app_mode =3D (c =3D=3D 'h');