From nobody Mon Jul 18 19:14:55 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Lms9G2d9Fz4Wx1Y; Mon, 18 Jul 2022 19:14:58 +0000 (UTC) (envelope-from asiciliano@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lms9G1wgBz3j5T; Mon, 18 Jul 2022 19:14:58 +0000 (UTC) (envelope-from asiciliano@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658171698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L+s2PCLhCEvOhB6Qy43BZ44URivUex6OOpzVCIbAN+w=; b=lUmhcVn93deacM/aCVYGVYY5nm1VFouyfAxAdXcjPJh5DxWZlvDXkVa5ufbuHXRniEosBU BdXT1k/PClo3tzMUqeMbBK8y3EvBJc2XO804PfshGdV6wCXDRqs0wjYTl73Pe7PsJTkqKN 8MkjetMuSOmMvFc932QXLKpGU3PpV4Uq9CURt9dA+nk2ksBTnK5XKGN6eR7B7VtoqAwF78 9geTiLqgkp+9XLiC+YNnfU/GV38wIYi+R+1nH4m46vE6JYzQXmwSjlptt5ju7QT44FKniW wraFoE1rMQr5W5JTVQAUUI4iqq0ISd1GTNn5NRbd9wPy9Z8e8+rdkvFH8WYcCQ== Received: from [192.168.1.26] (host-79-23-244-46.retail.telecomitalia.it [79.23.244.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: asiciliano) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Lms9F2Yx0z1LBw; Mon, 18 Jul 2022 19:14:57 +0000 (UTC) (envelope-from asiciliano@FreeBSD.org) Message-ID: <89a99668-65a7-8fc3-f94b-31e60861b0d0@FreeBSD.org> Date: Mon, 18 Jul 2022 21:14:55 +0200 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: git: 6368dcb29228 - main - bsdinstall hostname: Replace dialog with bsddialog Content-Language: en-US To: Devin Teske , Jessica Clarke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <6FF4C58E-A52C-446F-8DB0-C5EE708DBCEB@freebsd.org> <258A0FF7-F770-4574-AA6F-933EC7688C82@freebsd.org> From: "Alfonso S. Siciliano" In-Reply-To: <258A0FF7-F770-4574-AA6F-933EC7688C82@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658171698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L+s2PCLhCEvOhB6Qy43BZ44URivUex6OOpzVCIbAN+w=; b=tesomZ0c98g+0PKex3z1aoLo7JuRZPYOhjcaJ2jJnsfTnEOJhPdMzM2G2a7Q0IN9Nr+Cq0 Ufes/VziT7YEiDxLxmaiYeZXc/i4vfU7qyatCunZE/QaSXfcvrmp6wntsStKuPjifnQQmx wn1Fq82CBskBt9V2cJm1kyFs0KXX+NAgSC8B2gdj3xRJ3roUd5NYNiPTYObvzCSet83Vl4 vwWVDPa/8yacnTU/K+H/k1f9CfFQcJ69M3+S10L2kWauP+RRsIcWjgg0V4gma30fNz654Y OgF/xh5bqvCp0+1kiAu/fXYWRj5rIXsT5U+Yp/dPyAAedUbNtKsL9GmZNsOCCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658171698; a=rsa-sha256; cv=none; b=ujDKjePyF/V16vBwrEbKgH44yixH1Pw4R5wpSldhuxYy0qP4C+YeJtEYKjfafPT/oxf+1Q Kk8iHHTeEio7tIdX9+FhUHyfGUPUD1CmPR6BaqVn/oWlrW+m+ZL33C3tK3eze9efFji1lV Gz35D9zz7Fd44wHhUvrO50RHVjz5xxbaw1TrepemVZL4E+K9nHbe1kBn+Wq9CLfqeyZrak YRzYlBlJvpHBMK5OMDMf5b+TTHycUE/bCkTpS5B8HnkOvkTZa/5q5t/axer/KsdKSJAtXY wXkYYuRzdNL6gMLatDrdbEXs7vr2ZGCKePUs61sYbst162MgGaI4cqAg/dJHVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 7/17/22 06:36, Devin Teske wrote: > > > Sent from my iPhone > >> On 15 Jul 2022, at 12:50 AM, Jessica Clarke wrote: >> >> On 24 May 2022, at 13:20, Alfonso S. Siciliano wrote: >>> >>> The branch main has been updated by asiciliano: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=6368dcb29228dd8e18d50c54c3ca1596262d4676 >>> >>> commit 6368dcb29228dd8e18d50c54c3ca1596262d4676 >>> Author: Alfonso S. Siciliano >>> AuthorDate: 2022-05-24 12:04:24 +0000 >>> Commit: Alfonso S. Siciliano >>> CommitDate: 2022-05-24 12:20:22 +0000 >>> >>> bsdinstall hostname: Replace dialog with bsddialog >>> >>> Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility. >>> Add --hline info because bsddialog requires TAB to switch the focus on >>> buttons for an inputbox, dialog differs. >> >> This is quite infuriating and bad UI/UX, everyone knows you can just >> type and press enter at these kinds of dialogues, yet bsddialog doesn’t >> support this. Are there any plans to address this shortcoming so >> bsddialog can work like every other dialogue box out there and how most >> users would expect? This is an unfortunate regression over (LGPL) >> dialog and I personally believe bsddialog should have been fixed rather >> than introducing this clunky experience to document the flaw. >> > I apologize for the infuriating and bad UI/UX, if I have understood: $ dialog --inputbox Input 0 0 0 $ bsddialog --inputbox Input 0 0 0 $ dialog --form Form 0 0 2 L1: 1 1 X 1 5 20 25 L2: 2 1 X 2 5 20 25 $ bsddialog --form Form 0 0 2 L1: 1 1 X 1 5 20 25 L2: 2 1 X 2 5 20 25 The problem is TAB -> ENTER instead of only ENTER to close the dialog. It has a rationale, probably too boring to describe in this context. Anyway, Yes, "just type and press enter" to close an --inputbox is already in the TODO list. Actually there is a plan to refactor the complete "form module", I hope to finish by August/September. . Please let me know if you need a revert now to solve immediate. bsddialog was designed and implemented for FreeBSD, bsdinstall is the first real use case, it was introduced in CURRENT for testing, changes and improvements. Suggestions, feedback and new ideas are welcome. > Not to mention that removing dynamic auto-sizing smacks international users in the face because “0 56” might look good to your English text but not i18n text. > > What’s that? This code is not i18n’d? > > Not yet — but fixing the size of the box is a step backwards regressing away from embracing i18n already patterned by bsdconfig. > > I observe. > — > Devin > width-auto-sizing for --inputbox is implemented but I disabled it temporarily, Because it can be improved. Properly the utility calls bsddialog_form() for each form-like, I' ll improve the auto-sizing by implementing a real inputbox() function, already in the TODO list. I used a fixed size like temporary solution because other scripts in bsdinstall RELEASE/CURRENT use fixed width [~40 - ~72]. (56 is only the dialog width, an user can type over 2000 unicode chars, the text will be shifted). bsddialog forms should support widechars already, at least for the typing field. So far I implemented the unicode support only for the forms to improve bsdinstall in the future. Indeed some user reported some problem with no-English chars (PRs are not related to bsddialog, the scripts use other tools, bsddialog can solve in the future): I hope to import a new bsddialog version by September/October with an improved autosizing for inputbox and a complete unicode support for each dialog (this includes sizing and text-wrapping with multi bytes charachters). Currently I am replacing char with wchar_t in libbsddialog, the library will use widechars internally. Moreover, I was able to change my DE (XFCE) in Japanese and I am going to buy a Japanese keyboard to make testing easier. Of course, I'll investigate/try to integrade bsddialog with bsdconfig. Probably the problem with the auto-sizing is the different dialog/bsddialog text-wrapping algorithm; I am quite sure this problem exists for text (aka prompt) and menu items (radiolist, checklist). The challenge is that I cannot read the LGPL dialog code to avoid violating the license. I opened a public review for this commit with author/maintainer, it is possible to collaborate not only to observe. Alfonso > >> Jess >> >>> Delete f_dialog_inputbox_size() using libbsddialog autosizing. >>> >>> Reviewed by: bapt >>> Differential Revision: https://reviews.freebsd.org/D35285 >>> --- >>> usr.sbin/bsdinstall/scripts/hostname | 14 ++++++-------- >>> 1 file changed, 6 insertions(+), 8 deletions(-) >>> >>> diff --git a/usr.sbin/bsdinstall/scripts/hostname b/usr.sbin/bsdinstall/scripts/hostname >>> index b151ef15c690..23adbe68ead0 100755 >>> --- a/usr.sbin/bsdinstall/scripts/hostname >>> +++ b/usr.sbin/bsdinstall/scripts/hostname >>> @@ -48,6 +48,8 @@ f_include $BSDCFG_SHARE/dialog.subr >>> >>> ############################################################ GLOBALS >>> >>> +: ${BSDDIALOG_CANCEL=1} >>> + >>> # >>> # Strings that should be moved to an i18n file and loaded with f_include_lang() >>> # >>> @@ -71,21 +73,17 @@ SET_HOSTNAME='hostname -s "%s"' >>> dialog_hostname() >>> { >>> local prompt="$msg_please_choose_a_hostname" >>> - local hline= >>> + local hline="Use TAB and Enter to select $msg_ok" >>> local value="$*" >>> >>> - local height width >>> - f_dialog_inputbox_size height width \ >>> - "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" "$value" "$hline" >>> - >>> - $DIALOG \ >>> + bsddialog \ >>> --title "$DIALOG_TITLE" \ >>> --backtitle "$DIALOG_BACKTITLE" \ >>> --hline "$hline" \ >>> --ok-label "$msg_ok" \ >>> --no-cancel \ >>> --inputbox "$prompt" \ >>> - $height $width "$value" \ >>> + 0 56 "$value" \ >>> 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD >>> } >>> >>> @@ -101,7 +99,7 @@ f_dialog_backtitle "$msg_freebsd_installer" >>> # Get user input >>> # >>> HOSTNAME=$( dialog_hostname "$HOSTNAME" ) >>> -[ $? -eq $DIALOG_CANCEL ] && exit 1 >>> +[ $? -eq $BSDDIALOG_CANCEL ] && exit 1 >>> >>> # >>> # Store the user's choice >>