From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 0AC293858D3C for ; Fri, 9 Jun 2023 14:37:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AC293858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 055AC1F889; Fri, 9 Jun 2023 14:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686321459; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KwkjmyVmf04XgOVQd46vFWXBxvfBj4JMwEpzuuUcEyo=; b=f68ZtqbYHoCu5V9k42luGrdWiOfsrWrYYI/l22NVnk9cBN4xpmJqvFffFqoRi5U9ts1+/f MEcSBxQXHEJrjYLaYefCvn3uD52xRpucvvx5oaXDt/bw7qOJfiGIpDWGiOkgPPQgLCBiD/ ipPHe9xhftulteKV0Kquqvg+0b+YODA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686321459; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KwkjmyVmf04XgOVQd46vFWXBxvfBj4JMwEpzuuUcEyo=; b=NFa+B/MFmC9fdRC+g9p4ErTwj9k5nYhgk3x/R2z41AWv1NNDXfMfpsMO4Ag2sowY2J0cdV Hg3oyw7lpDNSrTDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E525D13A47; Fri, 9 Jun 2023 14:37:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YwehNjI5g2TYcQAAMHmgww (envelope-from ); Fri, 09 Jun 2023 14:37:38 +0000 Message-ID: Date: Fri, 9 Jun 2023 16:37:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 2/2] [gdb/tui] Delete line buffer when switching to singlekey Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20230606150333.5206-1-tdevries@suse.de> <20230606150333.5206-2-tdevries@suse.de> <87sfb090wc.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87sfb090wc.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 6/9/23 16:16, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> The SingleKey "d" is supposed run the "down" command. > > Tom> Fix this by clearing the readline line buffer when switching to SingleKey > Tom> mode. > > I was wondering if saving and restoring the partial text would be > better, but honestly this is better than the status quo, and it's not > clear to me that people switch in and out of SingleKey so much that this > kind of detail would matter. > Thanks for the review. We can compare behaviour with C-x a: - type foo on gdb prompt - now enter TUI by typing C-x a - exit TUI again by typing the same - we see "(gdb) foo" but that's just an artifact, see PR30523 - we type space three times and backspace to overwrite the artifact - we can now type C-x y, and we get again "(gdb) foo", this time indeed in the readline buffer So, entering TUI with C-x a kills the prompt line and puts it in the kill ring. Exiting TUI does not restore it. I'm not 100% convinced that the choice of kill rather than delete is intentional either. The comment says: ... /* Clear the readline in case switching occurred in middle of something. */ if (rl_end) rl_kill_text (0, rl_end); ... So, I opted for a simple delete. Thanks, - Tom > So, seems good. > > Reviewed-By: Tom Tromey > > Tom