From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Fiona Ebner <f.ebner@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH common 1/4] pty: introduce read_line() function
Date: Mon, 22 Sep 2025 11:45:58 +0200 [thread overview]
Message-ID: <20250922114558.0247bac4@rosa.proxmox.com> (raw)
In-Reply-To: <20250918135215.95188-2-f.ebner@proxmox.com>
tested this patch with the patches for PMG from:
https://lore.proxmox.com/pmg-devel/20250918142052.131956-1-f.ebner@proxmox.com/T/#t
worked for me when creating an acme account with custom ACME provider, and
when joining a cluster.
Consider this:
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
On Thu, 18 Sep 2025 15:50:53 +0200
Fiona Ebner <f.ebner@proxmox.com> wrote:
> From: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
>
> Originally-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
> [FE: avoid changes to read_password()
> rename from read_input() to read_line()
> avoid undef warning if there is no input by avoiding chomp then
> print prompt even if not reading from interactive for better log]
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> src/PVE/PTY.pm | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/src/PVE/PTY.pm b/src/PVE/PTY.pm
> index 5d7d697..1db4863 100644
> --- a/src/PVE/PTY.pm
> +++ b/src/PVE/PTY.pm
> @@ -163,6 +163,23 @@ sub tcsetsize($$$) {
> or die "failed to set window size: $!\n";
> }
>
> +sub read_line($;$$) {
> + my ($query, $infd, $outfd) = @_;
> +
> + $infd //= \*STDIN;
> + $outfd //= \*STDOUT;
> +
> + my $msg = -t $infd ? $query : "$query\n";
> + print $outfd $msg;
> +
> + my $input = '';
> + local $/ = "\n";
> + $input = <$infd>;
> + chomp $input if $input;
> +
> + return $input;
> +}
> +
> sub read_password($;$$) {
> my ($query, $infd, $outfd) = @_;
>
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-22 9:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 13:50 [pve-devel] [PATCH-SERIES common/manager/qemu-server 0/4] fix #2077: remove dependency on Term::ReadLine Fiona Ebner
2025-09-18 13:50 ` [pve-devel] [PATCH common 1/4] pty: introduce read_line() function Fiona Ebner
2025-09-22 9:45 ` Stoiko Ivanov [this message]
2025-09-18 13:50 ` [pve-devel] [RFC common 2/4] developer readme: remove libterm-readline-gnu-perl dependency Fiona Ebner
2025-09-18 14:12 ` Fiona Ebner
2025-09-18 13:50 ` [pve-devel] [PATCH manager 3/4] partially fix #2077: remove dependency on Term::ReadLine Fiona Ebner
2025-09-18 13:50 ` [pve-devel] [RFC qemu-server 4/4] " Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250922114558.0247bac4@rosa.proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox