From patchwork Thu Jan 8 04:04:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 4563 Received: (qmail 23783 invoked by alias); 8 Jan 2015 04:05:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23726 invoked by uid 89); 8 Jan 2015 04:05:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qg0-f50.google.com Received: from mail-qg0-f50.google.com (HELO mail-qg0-f50.google.com) (209.85.192.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 08 Jan 2015 04:05:20 +0000 Received: by mail-qg0-f50.google.com with SMTP id z60so626840qgd.9 for ; Wed, 07 Jan 2015 20:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bT564cZ+CUVQI4Iejx2+Wum9PZiNxYxpFre6Y+NBh2U=; b=AWT0iyOdUWGY++rMsxowns/epgc2JcCbY3qqFbPW6Lu/9FTo2SgPDhuQIGSMuL8Vmf ov0TpJGhuQJKLQP7eG00IV+QPBhovFumhcwIIVB3dyXVwYUhFEOqLDRcNQmycz17nkUA qEu7hUPhRlqwbG4jwwK/sNU8FReI6p9iedRSsASU55O59U/MacbZpCVfG5wl8BYdJI7P Jj4xf5wmmZbnzmcJzClJZu62sU8+NOYvGyR8SRUKued51AVbhU1PkVYn2N9s3W4CSxwV KQzt1/I6EnEShx3MWXCGGLg0RgnlaWE/egIB70AL2tiEc5poRWr1+3hFRSRq3WuV3PMY o5qg== X-Gm-Message-State: ALoCoQmaZNRCcpN3+TJXWuwszySjS7bD0SXH4ajJeMTu2HNOyjV8hjWFaJsV42UDVPsCPbqFEpih X-Received: by 10.224.88.129 with SMTP id a1mr1371761qam.92.1420689918081; Wed, 07 Jan 2015 20:05:18 -0800 (PST) Received: from localhost.localdomain (ool-4353ac94.dyn.optonline.net. [67.83.172.148]) by mx.google.com with ESMTPSA id k2sm3039232qay.24.2015.01.07.20.05.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 20:05:17 -0800 (PST) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH 3/3] Don't flush the prompt when resizing the terminal within TUI Date: Wed, 7 Jan 2015 23:04:45 -0500 Message-Id: <1420689885-31156-3-git-send-email-patrick@parcs.ath.cx> In-Reply-To: <1420689885-31156-1-git-send-email-patrick@parcs.ath.cx> References: <1420689885-31156-1-git-send-email-patrick@parcs.ath.cx> This patch removes the ancient code that is responsible for forcing the prompt to get flushed and executed when tui_getc() detects that the terminal has been resized. This behavior is unintuitive and seemingly unnecessary. I tried figuring out why tui_getc() behaves this way, but git-blame does not reveal anything informative about this code. It probably has something to do with avoiding to print KEY_RESIZE keys, but the previous patch prevents that from happening anymore. gdb/ChangeLog: * tui/tui-io.c (tui_handle_resize_during_io): Remove parameter. Change return type to void. Don't call dont_repeat. (tui_getc): Adjust. --- gdb/tui/tui-io.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index b0e6c75..f072bdb 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -135,7 +135,7 @@ static int tui_readline_pipe[2]; This may be the main gdb prompt or a secondary prompt. */ static char *tui_rl_saved_prompt; -static unsigned int tui_handle_resize_during_io (unsigned int); +static void tui_handle_resize_during_io (void); static void tui_putc (char c) @@ -642,7 +642,8 @@ tui_getc (FILE *fp) #endif ch = wgetch (w); - ch = tui_handle_resize_during_io (ch); + + tui_handle_resize_during_io (); /* The \n must be echoed because it will not be printed by readline. */ @@ -709,19 +710,15 @@ tui_getc (FILE *fp) } -/* Cleanup when a resize has occured. - Returns the character that must be processed. */ -static unsigned int -tui_handle_resize_during_io (unsigned int original_ch) +/* Cleanup when a resize has occured. */ + +static void +tui_handle_resize_during_io (void) { if (tui_win_resized ()) { tui_resize_all (); tui_refresh_all_win (); - dont_repeat (); tui_set_win_resized_to (FALSE); - return '\n'; } - else - return original_ch; }