From patchwork Thu Aug 28 14:25:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 2573 Received: (qmail 19822 invoked by alias); 28 Aug 2014 14:26:06 -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 19810 invoked by uid 89); 28 Aug 2014 14:26:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qg0-f43.google.com Received: from mail-qg0-f43.google.com (HELO mail-qg0-f43.google.com) (209.85.192.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 28 Aug 2014 14:26:02 +0000 Received: by mail-qg0-f43.google.com with SMTP id f51so813448qge.30 for ; Thu, 28 Aug 2014 07:26:00 -0700 (PDT) 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; bh=QnR+sO3C+/QQGWyQlWW4LvCoZDNh3WFB4o9GgOg9SCg=; b=YhBJBZyIMBAZ9gFJJmnXA7dWlyk4vKie3B13ebmW3vxPTPEb9Bqgf1o8Bb7WvEeWI3 qFZcbD3tM5QOm5XCcm2WbXkuXzYKeHCtwHbss8dHf8J+0+DZGH8suW+qsw/+GtycsZTo fKZoh1HUf8vwT+Y3b5uSMmqzHTbdX6Jg3E09xOBjOJza8ucBNrD7Vb9FRXMKvAy1LWWf Ve8a1oofrj0fzTrw6Zf4buxqx6FKtJ8u7DUCxCVikQZb7DqUe8WNXprtdQtxlutXn+WV DuVLNqIP9WjGnQqM+031lpKimVuwmKdtH1N5sOFkxVi6ipYRBN+lytfPbUZ0QtbzSIOK w2UA== X-Gm-Message-State: ALoCoQmLp2nSGvafPqjtEQInKPuRVfRYpX9etgWVPNOa1FgIyu7rxW9yTKzWQyvkLN/Ek4IzRXjL X-Received: by 10.140.22.19 with SMTP id 19mr6761971qgm.18.1409235960749; Thu, 28 Aug 2014 07:26:00 -0700 (PDT) Received: from localhost.localdomain (ool-4353af5c.dyn.optonline.net. [67.83.175.92]) by mx.google.com with ESMTPSA id b7sm11986257qan.37.2014.08.28.07.25.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 07:25:59 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Don't flush the prompt when resizing the terminal within TUI Date: Thu, 28 Aug 2014 10:25:53 -0400 Message-Id: <1409235953-22013-1-git-send-email-patrick@parcs.ath.cx> X-IsSubscribed: yes 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. Removing this dubious code does not seem to cause any regressions in TUI. TUI handles resizes and user input just fine still. 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 | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 8eca106..5b929ee 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -146,7 +146,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) @@ -657,7 +657,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. */ @@ -720,19 +721,14 @@ 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; }