From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 17 Apr 2025 11:10:57 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u5LGr-001oah-06 for lore@lore.pengutronix.de; Thu, 17 Apr 2025 11:10:57 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1u5LGq-00015D-M4; Thu, 17 Apr 2025 11:10:56 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u5LGb-000153-1L for ptxdist@pengutronix.de; Thu, 17 Apr 2025 11:10:41 +0200 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u5LGa-000j3x-2l for ptxdist@pengutronix.de; Thu, 17 Apr 2025 11:10:40 +0200 Received: from localhost ([::1] helo=dude04.red.stw.pengutronix.de) by dude04.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u5LGa-00Fllw-2Q for ptxdist@pengutronix.de; Thu, 17 Apr 2025 11:10:40 +0200 From: Michael Grzeschik To: ptxdist@pengutronix.de Date: Thu, 17 Apr 2025 11:10:36 +0200 Message-Id: <20250417091036.3758538-1-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] busybox: add lineedit patches X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false In busybox the tabcompletion was broken. With the recent patches this is fixed. Signed-off-by: Michael Grzeschik --- ...printing-lines-during-tab-completion.patch | 37 +++++++++++++++++++ ...needit-fix-left-over-print-to-stdout.patch | 33 +++++++++++++++++ patches/busybox-1.37.0/series | 4 +- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch create mode 100644 patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch diff --git a/patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch b/patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch new file mode 100644 index 000000000..d9864d8d7 --- /dev/null +++ b/patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch @@ -0,0 +1,37 @@ +From c443f2d2c67b5e5080632819980799c55b7bb89f Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum +Date: Thu, 17 Apr 2025 11:00:43 +0200 +Subject: [PATCH 1/2] lineedit: fix printing lines during tab completion + +Indentation and escape characters are all output to stderr now, but the +matches themself remained on stdout leading to garbled output on Tab +completion. + +Print the results to stderr as well to fix this. + +Fixes: fd47f056765a ("lineedit: print prompt and editing operations to stderr") +Signed-off-by: Ahmad Fatoum +--- + libbb/lineedit.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/libbb/lineedit.c b/libbb/lineedit.c +index 543a3f11c3e4..1f4b011008b6 100644 +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -1170,9 +1170,10 @@ static void showfiles(void) + ); + } + if (ENABLE_UNICODE_SUPPORT) +- puts(printable_string(matches[n])); ++ fputs(printable_string(matches[n]), stderr); + else +- puts(matches[n]); ++ fputs(matches[n], stderr); ++ bb_putchar_stderr('\n'); + } + } + +-- +2.39.5 + diff --git a/patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch b/patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch new file mode 100644 index 000000000..6c0d00e18 --- /dev/null +++ b/patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch @@ -0,0 +1,33 @@ +From 40a8532dea18363fb67466e1b02651cc964017e8 Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum +Date: Thu, 17 Apr 2025 11:00:43 +0200 +Subject: [PATCH 2/2] lineedit: fix left-over print to stdout + +There's code printing to stderr both before and after the single call to +puts inside put_cur_glyph_and_inc_cursor(). + +This is likely an oversight as we want everything to go through the +same file descriptor, so switch it over to fputs. + +Fixes: fd47f056765a ("lineedit: print prompt and editing operations to stderr") +Signed-off-by: Ahmad Fatoum +--- + libbb/lineedit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libbb/lineedit.c b/libbb/lineedit.c +index 1f4b011008b6..206fc36ef5c0 100644 +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -451,7 +451,7 @@ static void put_cur_glyph_and_inc_cursor(void) + * have automargin (IOW: it is moving cursor to next line + * by itself (which is wrong for VT-10x terminals)), + * this will break things: there will be one extra empty line */ +- puts("\r"); /* + implicit '\n' */ ++ fputs("\r\n", stderr); + #else + /* VT-10x terminals don't wrap cursor to next line when last char + * on the line is printed - cursor stays "over" this char. +-- +2.39.5 + diff --git a/patches/busybox-1.37.0/series b/patches/busybox-1.37.0/series index 87fee5091..f403c5683 100644 --- a/patches/busybox-1.37.0/series +++ b/patches/busybox-1.37.0/series @@ -7,4 +7,6 @@ 0201-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch 0202-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch 0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch -# e781b8c6838e27fd021f9c1a9f87654d - git-ptx-patches magic +0204-lineedit-fix-printing-lines-during-tab-completion.patch +0205-lineedit-fix-left-over-print-to-stdout.patch +# de06cc1132910215a67ae025e9b0aaa9 - git-ptx-patches magic -- 2.39.5