Message ID | 1420689885-31156-2-git-send-email-patrick@parcs.ath.cx |
---|---|
State | New, archived |
Headers |
Received: (qmail 23930 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: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23731 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-qa0-f54.google.com Received: from mail-qa0-f54.google.com (HELO mail-qa0-f54.google.com) (209.85.216.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 08 Jan 2015 04:05:12 +0000 Received: by mail-qa0-f54.google.com with SMTP id i13so5790999qae.13 for <gdb-patches@sourceware.org>; Wed, 07 Jan 2015 20:05:10 -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=Hg6Tgdhrm6PnF8l3cL1t8PxwxLgJnEFvUsa4FQCwOFg=; b=Vz7KiqxTSsiHvjR/W/prREuqbltin25WnxzzgOhSENvYyT5CWbKCWstuSQ0t52MykH +rsKd0S4GFoM1TdfTCUEZQnA64H/AmEwplRKGK3yL7Sj1/CBo3MrqnLXD34wwljEIB68 Mn6H1C3txqaGGrLGj5IA78W0t10eGKLlRnEWNIo73QcehchDhzdVr6cMDIBmW4nrJ41q ou8FvXvzy3mRVBopn+KwQy5QcIdKOdO3Fq6/EgKhiCGIgIaBJkC4oaRj1zdrhqTe2c1A y8bwODuGaVGAQiBCy1To7fqidKD9Gt1yljFe9IVPsUP3E4GqulBBvfc/HWiOIupt3e/3 /keA== X-Gm-Message-State: ALoCoQmN7GlvN2l2mNgIfcwoE3Gdw3NKHiYfdkYImUunBaijuB6oKJvNJvuGMFMo6Tyw7D/3ZEF/ X-Received: by 10.140.49.5 with SMTP id p5mr10790059qga.15.1420689910856; Wed, 07 Jan 2015 20:05:10 -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.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 20:05:10 -0800 (PST) From: Patrick Palka <patrick@parcs.ath.cx> To: gdb-patches@sourceware.org Cc: Patrick Palka <patrick@parcs.ath.cx> Subject: [PATCH 2/3] TUI: Don't print KEY_RESIZE keys Date: Wed, 7 Jan 2015 23:04:44 -0500 Message-Id: <1420689885-31156-2-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> |
Commit Message
Patrick Palka
Jan. 8, 2015, 4:04 a.m. UTC
wgetch() sometimes returns KEY_RESIZE when ncurses detects that the terminal has been resized. This character then gets passed on to readline which interprets it as a multibyte character. Instead of passing on this character to readline, intercept it as a (no-op) control character and pass '\0' to readline. gdb/ChangeLog: * tui/tui-command.c (tui_dispatch_ctrl_char): Ignore KEY_RESIZE keys. --- gdb/tui/tui-command.c | 1 + 1 file changed, 1 insertion(+)
Comments
On 01/08/2015 04:04 AM, Patrick Palka wrote: > wgetch() sometimes returns KEY_RESIZE when ncurses detects that the > terminal has been resized. I think curses SIGWINCH handler ends up _not_ installed, right? We install our own, and so does readline. So how did a resize manage to be detected/processed while inside wgetch? Thanks, Pedro Alves
On Thu, Jan 8, 2015 at 6:29 AM, Pedro Alves <palves@redhat.com> wrote: > On 01/08/2015 04:04 AM, Patrick Palka wrote: >> wgetch() sometimes returns KEY_RESIZE when ncurses detects that the >> terminal has been resized. > > I think curses SIGWINCH handler ends up _not_ installed, right? > We install our own, and so does readline. > So how did a resize manage to be detected/processed while inside > wgetch? I'm pretty sure that the SIGWINCH handlers does not get installed. However ncurses may detect a resize event when we exit TUI (exiting ncurses), then resize the terminal, then re-enter TUI (restarting ncurses). From there a KEY_RESIZE key is added to its internal FIFO. And the next call to wgetch will return this KEY_RESIZE key. > > Thanks, > Pedro Alves >
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index d1a5ddb..dfcf512 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -121,6 +121,7 @@ tui_dispatch_ctrl_char (unsigned int ch) tui_scroll_right (win_info, 1); break; case '\f': + case KEY_RESIZE: break; default: c = ch_copy;