From nobody Mon Nov 25 04:25:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1718266064; cv=none; d=zohomail.com; s=zohoarc; b=RopipSO4u7s+1qzqiEU6jv82qIJGfl6egq46r9ZWcR8ssclQmk18S6UUWK32A87mTbSrLXdC5fM2FDhE13lZt05WJG9MM0QcufpF54piee5qxz40iOPq+41VX+de+z2mMK5jyJ7s2G/NIWJbghb/8wzt8saYP5ZLtmy586S6AFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718266064; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o245QK4N25S806OomhIBP0oO91KklkhB6AHD4fZXGb0=; b=QliYc7j1QFOac1OfrL1fBnyced2yr+h7378D8Hhy7y0FXD/yCbT0YEL9/YVbuiF63BIcKTGQwcYsbWQvdpLu6Uxa3YpAGKxHXO0o68wijJh/KhfqDQgRwAFZyt1VkkTGQ9H5F/AL/SBjxYmNIJgXmfT8n9v/MjFjsNLsEE6AVtg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718266064032655.2152513928804; Thu, 13 Jun 2024 01:07:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHfU6-0000SV-Rb; Thu, 13 Jun 2024 04:07:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHfU5-0000PJ-Ah for qemu-devel@nongnu.org; Thu, 13 Jun 2024 04:07:01 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHfU3-0008H2-Mz for qemu-devel@nongnu.org; Thu, 13 Jun 2024 04:07:01 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-35f2c9e23d3so1189065f8f.0 for ; Thu, 13 Jun 2024 01:06:59 -0700 (PDT) Received: from localhost.localdomain (adsl-105.37.6.1.tellas.gr. [37.6.1.105]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075104d88sm910811f8f.104.2024.06.13.01.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 01:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718266017; x=1718870817; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o245QK4N25S806OomhIBP0oO91KklkhB6AHD4fZXGb0=; b=e80nUtK9YJZjef7ZfXtaX3jJPuQjDUtHrkqhLxpv6jIfC5nnwL2S8uBapR1EMOhbMb 7rRU0kYPldZwtHAmlMrh5mnGlYrmXUTTbhuKvlRkXVr9GofU9HzH0w0v+SYzUiuMIC/O UEnhwhLFRFjJIJM415FYKGgAkHooVyRkmQgURu9MVDKP5l+liV7DUlpXCIE000CTAN6u uZRXqMYQXdM9Dx0jcxDNpVphyYW2WNk/7C8XeuJFId0MY6sPBEzr+RXMrQ+lIUUYVcUO eH8e2vMjiiwv5FuvHRXPO5bkScQS1veUfYgWfT+c2dpCu4wMD5hG8DCEqFg0wEbumCAd BOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718266017; x=1718870817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o245QK4N25S806OomhIBP0oO91KklkhB6AHD4fZXGb0=; b=wDuPnbka1t3Nt3KEWLD4yJteGk4QGXt2pVZYn3fQvqKGoO3KA3HiJYXgz/mCS25TyZ y3bYBlsT0iUUT8y+LKq6GdxTszae6a9qEiOUTIO2KZWFLqCh/VYDgUl0jEOlEZBcYPcL 3nJOwwxy+psgDxaiwkXyNrOOQ/Y8lEItV8K1tUwZBzIg+HaH8Y3GNE0OMAW8rBrALu7I at8VuxmvIvqG6yiSlzs2HIBE9ZDnRtExSwSYZtYzuBFMeDdMG8DCrQYiy+OiBh1O1Q0P UVp7HcKsI2YtTnRPn4HLFKOyp+Q3oXxkDKNhlACtPpH1obk/9B9jX7gKDTuiHbeXz8bH VyWg== X-Gm-Message-State: AOJu0YzVO7X7kQXEwWSVRIYfZpbL/PBuqFswYLgqN8VHRaAfOp0QvYL0 hpHlOs45/TONyUEsAIU8bhnhKBzIxYWU9k+RCLKRa+fp5d40JrSZcRaGnW6xq6Afewt4gLLYorj 2b3k= X-Google-Smtp-Source: AGHT+IFJC4mWdREdKyi1SdnbGLaP68DJBWUeOVAJbSxN80qM87ZrIH0jjAtz2ETlSA2uxzJ+GCTaGg== X-Received: by 2002:a05:6000:18cd:b0:35f:1acd:750 with SMTP id ffacd0b85a97d-360718e4d0fmr1417935f8f.25.1718266017620; Thu, 13 Jun 2024 01:06:57 -0700 (PDT) From: Manos Pitsidianakis To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v1 1/3] util/readline.c:fix lints for readline_handle_byte Date: Thu, 13 Jun 2024 11:06:11 +0300 Message-ID: <16f745ac7f5fef74498709ffd98857e76edff6aa.1718265822.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1718266066210100001 Content-Type: text/plain; charset="utf-8" While they do not give warnings under our current buildsystem configuration, my clang's language server daemon was complaining about missing default: labels in switch statements. While at it, add /* fallthrough */ annotations where appropriate. This is a purely style and not functional change. Signed-off-by: Manos Pitsidianakis Reviewed-by: Marc-Andr=C3=A9 Lureau --- util/readline.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/util/readline.c b/util/readline.c index 494a3d924e..ded31b04b7 100644 --- a/util/readline.c +++ b/util/readline.c @@ -405,7 +405,7 @@ void readline_handle_byte(ReadLineState *rs, int ch) case 12: readline_clear_screen(rs); break; - case 10: + case 10: /* fallthrough */ case 13: rs->cmd_buf[rs->cmd_buf_size] =3D '\0'; if (!rs->read_password) { @@ -425,7 +425,7 @@ void readline_handle_byte(ReadLineState *rs, int ch) case 27: rs->esc_state =3D IS_ESC; break; - case 127: + case 127: /* fallthrough */ case 8: readline_backspace(rs); break; @@ -452,11 +452,11 @@ void readline_handle_byte(ReadLineState *rs, int ch) break; case IS_CSI: switch (ch) { - case 'A': + case 'A': /* fallthrough */ case 'F': readline_up_char(rs); break; - case 'B': + case 'B': /* fallthrough */ case 'E': readline_down_char(rs); break; @@ -480,12 +480,15 @@ void readline_handle_byte(ReadLineState *rs, int ch) case 4: readline_eol(rs); break; + default: + break; } break; default: break; } rs->esc_state =3D IS_NORM; + /* fallthrough */ the_end: break; case IS_SS3: @@ -496,9 +499,13 @@ void readline_handle_byte(ReadLineState *rs, int ch) case 'H': readline_bol(rs); break; + default: + break; } rs->esc_state =3D IS_NORM; break; + default: + break; } readline_update(rs); } --=20 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89 From nobody Mon Nov 25 04:25:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1718266071; cv=none; d=zohomail.com; s=zohoarc; b=QeZcbhTzRj2BSKDtovMy6VwutKaH/etyrSG/XhLg3zq3H4IOo/mDrhJTdpBG/ixN1rUdbD46JxFKevd83T4Fn1VIudD4W+ckMdQ7kaZ88hnCdiblQF16d4/ws0myL8ROvfoLwMEgn5MPV9hKPplGfeHPYssvp1/MIi741WAsBhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718266071; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=31cNCR2mzBLKID4O2IUSTWgxKOCqpW5ErAleu4fDPAI=; b=J20/yE6F5UD1w9LiFi/8dMZ/K2M0CflshIx8fQGRLdjd+PmF5dV+RrhMj6997ZQ7TwB596uS0Pua5fqAe/6QxcsARFfSTYBQMjuEwSb9QA0I69yatH0GdCZQ46FWjbB/PZoe1CA8U/cuZneDHIjtu7K4yYB3yKMlDlKcGkM6e3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718266071715766.1079260065486; Thu, 13 Jun 2024 01:07:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHfUA-0000WL-8T; Thu, 13 Jun 2024 04:07:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHfU8-0000UG-0R for qemu-devel@nongnu.org; Thu, 13 Jun 2024 04:07:04 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHfU6-0008IO-Ek for qemu-devel@nongnu.org; Thu, 13 Jun 2024 04:07:03 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-52bd48cf36bso983380e87.3 for ; Thu, 13 Jun 2024 01:07:02 -0700 (PDT) Received: from localhost.localdomain (adsl-105.37.6.1.tellas.gr. [37.6.1.105]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075104d88sm910811f8f.104.2024.06.13.01.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 01:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718266020; x=1718870820; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=31cNCR2mzBLKID4O2IUSTWgxKOCqpW5ErAleu4fDPAI=; b=hJ3qTq6V4EdDSLboMb23SlJnwVw8zW/hmDcpSaGYvyFn21zUqzvc4W+1xLyqYWZ2Kw zhl/gIJD+MQiylQA/prxSIVQM7XYAyPcHrhMiszR+cnuR2N8tFflW3Ehf3noifp6xD+Z dB8Ucr7Xh6Y1WB1E17o0SgewR8ibir479lUMA5uTcXpp9vObdjyrHGVBpHosOaw5tlY6 0b/CpHs8Qlb3cxJ8PzoEf2TtBUPwM16GbGe/xzmKQe4RSMPv+IPfTYFobtu2yO6y+7PY BFoi1o2eZ31wKGSg9oX9ZqaXQVGkCvzJ5OKPjWa+Z49yxi5rijh9zWS1XgQgeAaUrUH7 Wrpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718266020; x=1718870820; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=31cNCR2mzBLKID4O2IUSTWgxKOCqpW5ErAleu4fDPAI=; b=gxXw2Me+1tuOOkf5DQDqMVnrNTWRxYLz7YxM0zJFZSya1d4npm1IrFWlTBs2ws4hiK gRrDMzbV8CQoB4vTZLt1+SK3oErfFYFLuFOYIaV6+m0D3BaSicwIJXzRx5j4WszS8cwT HFr606fWi+HW7ffp9tS8DgMYfYX+3j8qq7WSiAUv1nOA1yMsn23M9Qv3TYsbdVCtQ3Fz g/jPtA5qhX9YKU78pBvOyebU+HfXlaj2d4xqX0k8Og1pBFWJ5AyrOoTP7lUoQZmEi+l1 8o1vMUNYmytbKPD2vw39Y/38hs0I35JYnaSlQqCdZY3SWItiHNMpyUbpFY/DOltNFA02 pu9w== X-Gm-Message-State: AOJu0YxH7MLpI+X4MMBMH5W8zgfKjTEa0bHAHfZy3VSgH4Vk+pwnanqG lS208qtWyxHPTsbHYIw9BXcbP4U4YXh4IJ2N0qR3DCzyu9Df6tjPs7Gn1A2xxF4Ng/S0ELwayDr 9s38= X-Google-Smtp-Source: AGHT+IHZnsu0Q+oMiLFXGRzAgK3YLxw4QZYh3CCVVjQfWIn+iYI/JPMAZEP5PibTw3RyoJ/+sL9FVA== X-Received: by 2002:a05:6512:3083:b0:52b:c88f:b107 with SMTP id 2adb3069b0e04-52c9a3d9747mr3245894e87.33.1718266020460; Thu, 13 Jun 2024 01:07:00 -0700 (PDT) From: Manos Pitsidianakis To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v1 2/3] util/readline.c: add C-n, C-p shortcuts Date: Thu, 13 Jun 2024 11:06:12 +0300 Message-ID: <9876594132d1f2e7210ab3f7ca01a82f95206447.1718265822.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-lf1-x129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1718266072216100001 Content-Type: text/plain; charset="utf-8" C-n and C-p are the default bindings for readline's next-history and previous-history respectively. They have the same functionality as the Down and Up arrow keys. Signed-off-by: Manos Pitsidianakis Reviewed-by: Marc-Andr=C3=A9 Lureau --- util/readline.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/readline.c b/util/readline.c index ded31b04b7..0b627d62ad 100644 --- a/util/readline.c +++ b/util/readline.c @@ -418,6 +418,14 @@ void readline_handle_byte(ReadLineState *rs, int ch) rs->last_cmd_buf_size =3D 0; rs->readline_func(rs->opaque, rs->cmd_buf, rs->readline_opaque= ); break; + case 14: + /* ^N Next line in history */ + readline_down_char(rs); + break; + case 16: + /* ^P Prev line in history */ + readline_up_char(rs); + break; case 23: /* ^W */ readline_backword(rs); --=20 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89 From nobody Mon Nov 25 04:25:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1718266044; cv=none; d=zohomail.com; s=zohoarc; b=acXsF4IZojrmqBpsli+56X6dPa/qE77HJEOai3Z0nmvJOeIZVHtj4DjdVoBb5EQiheyi6iFcxF2vQziG+j3r7Z4Z2jD1yNFyeoP2Ilhs8EDAg8NeOV0IL23RERxnKFf5gNJLG1XO+vmR+l87AhviwATqZQ9pS7bZAXTRJ3IKrRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718266044; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H0HL0/tVcV9enNc0XY8fXI7wJenL+7Z2ycjUc8zKtd4=; b=fKbhByJufmIAvaNQqWUuc/54kk95NsYntyAR/FwIn8Wd44wZf3+QZMEXrqscOLArr0R0rfqCD/kcltVQWi287VeYqbBqlaXLMitfU3UoyyxxOXGWKsvPtaArCuibKVww3EE5/dYzEOrq+OHZSQ3wjwWRFLSTQVPkWY+AkamCVlY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718266044809879.3525478397421; Thu, 13 Jun 2024 01:07:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHfUC-0000Xx-WD; Thu, 13 Jun 2024 04:07:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHfUB-0000Wb-5I for qemu-devel@nongnu.org; Thu, 13 Jun 2024 04:07:07 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHfU9-0008Ib-I1 for qemu-devel@nongnu.org; Thu, 13 Jun 2024 04:07:06 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-52b7ffd9f6eso795841e87.3 for ; Thu, 13 Jun 2024 01:07:05 -0700 (PDT) Received: from localhost.localdomain (adsl-105.37.6.1.tellas.gr. [37.6.1.105]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075104d88sm910811f8f.104.2024.06.13.01.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 01:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718266023; x=1718870823; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H0HL0/tVcV9enNc0XY8fXI7wJenL+7Z2ycjUc8zKtd4=; b=UKIzJfAtTRn8uv/Yg42EQfM9RaCJH0L9K3IS0aH0ESnBBaLWMUMgyDIWAm18NO4yOk FcDei4LRbYMwqc20dwJWDWhnXXgxrWShXqgy42U0SWE3+DVEAStFIAKii+mYitMBy5Q0 +sVoCyxf5iu5X755mCWKWnr654XnTT1ylkKBi1yxh2K3GKcR4vRCr8S9FGTDh4rPQwVM T3uUjmU5Ky5Op3q2hBFxm1zI5isz+fOaK4J6hYYRBOeDsZL2VKCUiDvVMkq5trQBgC1F fRyYWg9gHSIhhOaiciP5voOA8mhi+9ve83TYeTM/JoD0PofK4zKBkGW6dGxNoOkxtqsP qytQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718266023; x=1718870823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H0HL0/tVcV9enNc0XY8fXI7wJenL+7Z2ycjUc8zKtd4=; b=HazOsSGA2KkwCtqr0zEYE/58dWF3nFqKrjGdhvBzytLaRJrtIgQLAwITAbE5Gt0ek+ 1MxK1Gh/D1x+XsFxHlKnE9DBBftwEmWuXwt5CexDBHhGEm277RNtSqEvgeHOG7qLVAzq CHszOzrllA7o4HEJ1CjoxSr3u92fXhkmf5WqguN42IlLMphRCsQi/ATCsFV+TSqjw+Go pUwBrchN3oKrYDv+Yxnvmx6a9/6OCGiAScEROk9FODAmN3fpf/H23EAkY9w5yZVVEf4F k3YQ4Edc0bq6+mBcmEJ0Ns3QXBQt8ElJm+ce0G/LjGl4TkbYzS6tYMGNlPH42kVLvJi7 zjxw== X-Gm-Message-State: AOJu0YzIrYrPmTf9LSfkFt1/fIZxlRdhZhrnwBUPkjVE+c4m/iN+Uzrt 99TH1oCwXyKiYJCe7OuK43U3UPxfL16Nfl0u0m01SsmPu3CVtlpjymgQ+rziNmeyHIZ2ITIVOv7 OsII= X-Google-Smtp-Source: AGHT+IFruD4qHGal+kOkwGFXynZZ6VzLjNsVBDoNtj9Wx6s9l7aUVTeuodBnamQmuHhtx6+B8e1yOA== X-Received: by 2002:a05:6512:6d1:b0:52b:c29a:7493 with SMTP id 2adb3069b0e04-52c9a3dd87cmr2987858e87.33.1718266023524; Thu, 13 Jun 2024 01:07:03 -0700 (PDT) From: Manos Pitsidianakis To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v1 3/3] util/readline.c: add C-u shortcut Date: Thu, 13 Jun 2024 11:06:13 +0300 Message-ID: <6772067e1c0d4b1c5310e5446e9e3e1c6b3b5bc0.1718265822.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1718266046099100001 Content-Type: text/plain; charset="utf-8" Add support for the unix-line-discard readline action, which erases from the cursor position up to the beginning of the line. The default binding, C-u, was chosen. This is useful to quickly erase command input while working on the monitor interface. Signed-off-by: Manos Pitsidianakis Reviewed-by: Marc-Andr=C3=A9 Lureau --- util/readline.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/readline.c b/util/readline.c index 0b627d62ad..0f19674f52 100644 --- a/util/readline.c +++ b/util/readline.c @@ -271,6 +271,14 @@ static void readline_hist_add(ReadLineState *rs, const= char *cmdline) rs->hist_entry =3D -1; } =20 +static void readline_kill_line(ReadLineState *rs) +{ + while (rs->cmd_buf_index > 0) { + readline_backward_char(rs); + readline_delete_char(rs); + } +} + /* completion support */ =20 void readline_add_completion(ReadLineState *rs, const char *str) @@ -426,6 +434,10 @@ void readline_handle_byte(ReadLineState *rs, int ch) /* ^P Prev line in history */ readline_up_char(rs); break; + case 21: + /* ^U Kill backward from point to the beginning of the line. */ + readline_kill_line(rs); + break; case 23: /* ^W */ readline_backword(rs); --=20 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89