Created attachment 245623 [details] Screenshot FreeBSD 14.0-RC1 ENV: LANG=C.UTF-8 MM_CHARSET=UTF-8 TERM=xterm PuTTY: Window --> Translation --> Remove character set: UTF-8 How to reproduce: bsddialog --msgbox plop 0 0 Workaround: Enable Window --> Translation --> "Enable VT100 line drawing even in UTF-8 mode"
Thank you for the report and the screenshot. The problem is quite obvious looking at the image. The environment does not print unicode chars to draw borders. Probably `--ascii-lines` could avoid the garbled graphics: % bsddialog --ascii-lines --msgbox plop 0 0 In reality bsddialog does not handle the graphics, it is handled by ncurses. Precisely bsddialog uses ncurses API to print characters, strings, change colors and move the cursor. The "garbled graphics" are unicode charachters to print lines (used to implement the borders of a dialog). I' ll search a computer with Windows/putty to try to reproduce the problem. Anyway we can start the investigation. Scenario 1. I suspect some problem with ncurses <-> putty. It is a well known problem, many discussions exist online: - with an easy solution https://www.suse.com/support/kb/doc/?id=000018370 - with a comment by the ncurses maintainer https://stackoverflow.com/questions/37845244/acs-characters-not-working-in-putty-even-with-export-ncurses-no-utf8-acs-1 - another with the ncurses maintainer https://stackoverflow.com/questions/29955575/how-to-support-extended-curses-characters-with-putty - and so on... Could you try some solution online? Scenario 2. bsddialog has some problem. Please could you show the output: % bsddialog --version % /usr/bin/bsddialog --version % /usr/local/bin/bsddialog --version and the output of an easy test: % fetch https://gitlab.com/alfix/freebsd-lab/-/raw/main/ncurses_unicode_test.c % cc -D_XOPEN_SOURCE_EXTENDED ncurses_unicode_test.c -o ncurses_unicode_test -lncursesw % ./ncurses_unicode_test (Actually the last test does not use bsddialog, only ncurses, so we can understand the origin of the problem). Alfonso
Hi, Running "bsddialog --ascii-lines --msgbox plop 0 0" works, bapt replicated this by running putty (https://www.freshports.org/security/putty/) on FreeBSD too. This occurs on both 13.2 and 14.0 using a fresh checkout of the ports tree I just want to point out that this worked before switching and is probably something we want to fix before 14 gets released. Best regards, Daniel
I created a review to upload some screenshot and to find the better solution, review D42380.
Created attachment 246112 [details] ncurses borders with wide chars in putty I can use wide chars instead of utf8 to draw borders. This avoids runtime settings like "env NCURSES_NO_UTF8_ACS=1" and putty: "Window -> Translation -> [X] Enable VT100 line drawing even in UTF-8 mode". Tested witn ncurses in Current 15.0 (below) and putty (screenshoot). #include <curses.h> #include <locale.h> #include <err.h> #include <stdlib.h> /* * % cc -D_XOPEN_SOURCE_EXTENDED ncurses-acs-test.c -o ncurses-acs-test -lncursesw * % ./ncurses-acs-test */ int main() { int u8; char *locale; if ((locale = setlocale(LC_ALL, "")) == NULL) err(1, "Cannot set locale"); /* init ncurses */ if (initscr() == NULL) errx(1, "Cannot init curses (initscr)\n"); /* testing */ box_set(stdscr, 0,0); /* uses WACS_ (wide chars) */ //box(stdscr, 0, 0); /* uses ACS_ (UTF8 chars) */ mvaddstr(1, 2, "Testing Line-drawing"); mvaddstr(3, 3, "locale and ncurses."); mvprintw(4, 4, "1) locale: %s.", locale); mvprintw(5, 4, "2) ncurses version: %s, %d.", NCURSES_VERSION, NCURSES_VERSION_PATCH); u8 = tigetnum("U8"); mvprintw(6, 4, "3) U8 cap: %d, TERM: %s", u8, getenv("TERM")); mvaddstr(9, 3, "Unicode chars."); mvaddstr(10, 4, "1) locale encode: あいうえお"); mvaddstr(11, 4, "2) Unicode chars border (ACS_*): "); addch(ACS_VLINE); addch(' '); addch(ACS_HLINE); addch(' '); addch(ACS_ULCORNER); addch(' '); addch(ACS_URCORNER); addch(' '); addch(ACS_LRCORNER); addch(' '); addch(ACS_LLCORNER); addch(' '); addch(ACS_RTEE); addch(' '); addch(ACS_LTEE); addch(' '); mvaddstr(13, 3, "Wide chars."); mvaddwstr(14, 4, L"1) wchar: あいうえお"); mvaddstr(15, 4, "2) Wide chars border (WACS_*): "); add_wch(WACS_VLINE); addch(' '); add_wch(WACS_HLINE); addch(' '); add_wch(WACS_ULCORNER); addch(' '); add_wch(WACS_URCORNER); addch(' '); add_wch(WACS_LRCORNER); addch(' '); add_wch(WACS_LLCORNER); addch(' '); add_wch(WACS_RTEE); addch(' '); add_wch(WACS_LTEE); addch(' '); /* refresh and exit */ mvaddstr(20, 2, "Thank you to test <Press a Key to close> "); refresh(); getch(); endwin(); return (0); }
Oh, that looks nice!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=fb4e7422ac7a5e21b497763b301353a066dcd135 commit fb4e7422ac7a5e21b497763b301353a066dcd135 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2023-11-17 18:45:21 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2023-11-17 18:55:58 +0000 devel/bsddialog: Update to 1.0.1 Changes: https://gitlab.com/alfix/bsddialog/-/blob/main/CHANGELOG PR: 275134 274472 Approved by: fernape devel/bsddialog/Makefile | 3 ++- devel/bsddialog/distinfo | 6 +++--- devel/bsddialog/pkg-plist | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
(In reply to commit-hook from comment #6) I had problems with some of the dialogs since Nov (?), now I get "â"s in place of borders in make config in (xterm/terminus).
(In reply to jakub_lach from comment #7) | Testing unicode ncurses. | | | | locale and ncurses. | | 1) locale: pl_PL.ISO8859-2. | | 2) ncurses version: 6.2, 20210220. | | 3) U8 cap: -2, TERM: xterm | | | | | | Unicode chars. | | 1) locale encode: ă~A~Bă~A~Dă~A~Fă~A~Hă~A~J | | 2) wchar: | | 3) Unicode border chars (ACS_*): | - + + + + + + | | | | Thank you to test <Press a Key to close>
FreeBSD 14.0-STABLE #0 stable/14-ae8387cc8 amd64
Created attachment 246479 [details] screenshot
(In reply to jakub_lach from comment #10) To be precise, bsddialog --msgbox plop 0 0 works. Garbling is in portsconfig.
(In reply to jakub_lach from comment #11) Without X, config dialogs work (though borders are different than earlier), but the colours are off (that is, different shades than used in X). Pre changes/problems, both in xterm in X and in pure console dialogs looked more or less the same.
Hello jakub_lach@mailplus.pl, Thank you for the report. So to recap: > To be precise, bsddialog --msgbox plop 0 0 works. Garbling is in portsconfig. Please could you show the output of: % portconfig -v
(In reply to Alfonso S. Siciliano from comment #13) $ portconfig -v portconfig version: 0.6.1 (libbsddialog: 1.0.1).
(In reply to jakub_lach from comment #14) I cannot reproduce the problem with fresh 14 RELEASE iso and 15 CURRENT iso installation in VM. Are you using putty from ports? Did you deinstall devel/bsddialog and ports-mgmt/portconfig and reinstall them from ports? The output of: % bsddialog --version % /usr/local/bin/bsddialog --version And screenshots of: test in the Comment 4 % /usr/bin/bsddialog --msgbox base r 0 % /usr/local/bin/bsddialog --msgbox PORT 0 0
Created attachment 246522 [details] test 1
Created attachment 246523 [details] test 2
Created attachment 246524 [details] test 3
(In reply to Alfonso S. Siciliano from comment #15) $ bsddialog --version Version: 0.4 $ /usr/local/bin/bsddialog --version Version: 1.0.1 I do not use putty, I did reinstall bsddialog from ports (was not installed) and portconfig before tests. I use xterm and x11-fonts/terminus-font.
Ok bsddialog tests are right. > I do not use putty, I did reinstall bsddialog from ports (was not installed) You should reinstall portconfig now (after bsddialog) and retest. Then I am sure it is using the right lib version and the problem is only for portconfig. Anyway this PR is for putty and (lib)bsddialog, if portconfig continues with the error you could open a new PR.
Close this due to second submitter timeout. Please open a new PR if your issue persists.
A commit in branch vendor/bsddialog references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=be8846bd9e069f4a6bea3d769005bea96cf43990 commit be8846bd9e069f4a6bea3d769005bea96cf43990 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2024-05-16 13:24:49 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2024-05-16 13:24:49 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 CHANGELOG | 32 ++++++++++++ LICENSE | 2 +- Makefile | 12 ++--- README.md | 27 ++++++---- examples_library/gauge.c | 2 +- examples_library/mixedgauge.c | 2 +- lib/barbox.c | 86 +++++++++++++++++++++++++------- lib/bsddialog.3 | 37 +++++++++----- lib/bsddialog.h | 4 +- lib/datebox.c | 53 +++++++++++++++----- lib/formbox.c | 43 ++++++++-------- lib/lib_util.c | 111 +++++++++++++++++++++++------------------- lib/lib_util.h | 9 +++- lib/libbsddialog.c | 9 ++-- lib/menubox.c | 25 ++++++---- lib/messagebox.c | 15 ++++-- lib/textbox.c | 34 +++++++------ lib/timebox.c | 17 +++++-- utility/bsddialog.1 | 83 +++++++++++++++++++++---------- utility/bsddialog.c | 6 +-- utility/util_builders.c | 72 ++++++++++++++++++++------- utility/util_theme.c | 12 ++--- 22 files changed, 469 insertions(+), 224 deletions(-)
The tag vendor/bsddialog/1.0.2 references this bug: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bsddialog/1.0.2 tag vendor/bsddialog/1.0.2 Tagger: Alfonso S. Siciliano <asiciliano@FreeBSD.org> TaggerDate: 2024-05-16 13:25:47 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEE3rLDBf8Ek2yJx9ZuP57vrP03HjcFAmZGCXVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldERF QjJDMzA1RkYwNDkzNkM4OUM3RDY2RTNGOUVFRkFDRkQzNzFFMzcACgkQP57vrP03 HjfPQAgAtQl5Zi2ANayQMJgMooJOJif36QvThbtpVddDo0TgDrkR8bA9nwf9skZA ay8Cq7+nW8vqSwAfwGZyuNQ9RWtgH7CEKl3Wh99Gw1+cc2k8nuVMNbKwQ1woz4xw BhMYr+92L8SZ+JDww3Rt+fm49QmNSbVcxDJYmx/zU41+gm/KjnXRq0KXb5k6etZu FH4ILat4rsol/K56fUFkDpuEtUzOnDBIjC/U6k8tnTydZfhpMlDmGrZcBwsYZYWu D6oY59VFSLL87lCVkRxu9GydJjGOQVujun+UgNf+yBaDQWPrajIaDe+P/GoxDuZl UaWXImz9nB2qDpzoX28iIIMv8PiOIQ== =xB0S -----END PGP SIGNATURE----- commit be8846bd9e069f4a6bea3d769005bea96cf43990 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2024-05-16 13:24:49 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2024-05-16 13:24:49 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 CHANGELOG | 32 ++++++++++++ LICENSE | 2 +- Makefile | 12 ++--- README.md | 27 ++++++---- examples_library/gauge.c | 2 +- examples_library/mixedgauge.c | 2 +- lib/barbox.c | 86 +++++++++++++++++++++++++------- lib/bsddialog.3 | 37 +++++++++----- lib/bsddialog.h | 4 +- lib/datebox.c | 53 +++++++++++++++----- lib/formbox.c | 43 ++++++++-------- lib/lib_util.c | 111 +++++++++++++++++++++++------------------- lib/lib_util.h | 9 +++- lib/libbsddialog.c | 9 ++-- lib/menubox.c | 25 ++++++---- lib/messagebox.c | 15 ++++-- lib/textbox.c | 34 +++++++------ lib/timebox.c | 17 +++++-- utility/bsddialog.1 | 83 +++++++++++++++++++++---------- utility/bsddialog.c | 6 +-- utility/util_builders.c | 72 ++++++++++++++++++++------- utility/util_theme.c | 12 ++--- 22 files changed, 469 insertions(+), 224 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a6d8be451f62d425b71a4874f7d4e133b9fb393c commit a6d8be451f62d425b71a4874f7d4e133b9fb393c Merge: abb1a1340e3f be8846bd9e06 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2024-05-16 13:32:56 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2024-05-16 13:32:56 +0000 contrib/bsddialog: Import version 1.0.2 Implicitly import also 1.0.1, both versions are for fixing and feature requests. Fixing: Change --mixedform behavior to fix a bsdinstall fault avoiding to change the command line in wlanconfig. Feature requests: * Add keys to navigate menus. * Add key to redraw dialogs. * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY. See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in /usr/src/contrib/bsddialog/CHANGELOG for more detailed information. PR: 274472 Differential Revision: D42380 Merge commit 'be8846bd9e069f4a6bea3d769005bea96cf43990' contrib/bsddialog/CHANGELOG | 32 +++++++ contrib/bsddialog/LICENSE | 2 +- contrib/bsddialog/Makefile | 12 +-- contrib/bsddialog/README.md | 27 ++++-- contrib/bsddialog/examples_library/gauge.c | 2 +- contrib/bsddialog/examples_library/mixedgauge.c | 2 +- contrib/bsddialog/lib/barbox.c | 86 ++++++++++++++---- contrib/bsddialog/lib/bsddialog.3 | 37 +++++--- contrib/bsddialog/lib/bsddialog.h | 4 +- contrib/bsddialog/lib/datebox.c | 53 ++++++++--- contrib/bsddialog/lib/formbox.c | 43 ++++----- contrib/bsddialog/lib/lib_util.c | 111 +++++++++++++----------- contrib/bsddialog/lib/lib_util.h | 9 +- contrib/bsddialog/lib/libbsddialog.c | 9 +- contrib/bsddialog/lib/menubox.c | 25 +++--- contrib/bsddialog/lib/messagebox.c | 15 ++-- contrib/bsddialog/lib/textbox.c | 34 ++++---- contrib/bsddialog/lib/timebox.c | 17 +++- contrib/bsddialog/utility/bsddialog.1 | 83 ++++++++++++------ contrib/bsddialog/utility/bsddialog.c | 6 +- contrib/bsddialog/utility/util_builders.c | 72 +++++++++++---- contrib/bsddialog/utility/util_theme.c | 12 +-- 22 files changed, 469 insertions(+), 224 deletions(-)
Created attachment 250889 [details] Screenshot "make config" inside PuTTY, all garbled up This is marked "Closed", but I'm still having the problem with both PuTTY and FreeBSD's own native syscons (on a freshly-built 14.1/stable)... My LANG is set to uk_UA.KOI8-U and the KOI8-U fonts are loaded at boot with: fonts8x16="koi8-u-8x16" setting in /etc/rc.conf. Things look a little better inside xterm -- all the lines are drawn with Cyrillic Б-character, ugly, but usable. But on a FreeBSD console -- before I had the X11 up -- it was not usable at all. Until I forced it back to dialog4ports -- seems like it too early to deprecate that...
(In reply to Mikhail Teterin from comment #26) The update is not MFC to -STABLE, as far as I can tell.
(In reply to Mikhail Teterin from comment #26) The problem seem related to portconfig. Please could you check if it is bug #275304 or bug #275364. Otherwise you could open a new PR and/or add a new entry to Problems in wiki https://wiki.freebsd.org/portconfig.
(In reply to jakub_lach from comment #27) > The update is not MFC to -STABLE, as far as I can tell. Ouch. Shouldn't it be? At present, the "out of the box" 14.x is unusable for people like myself :( (In reply to Alfonso S. Siciliano from comment #28) > if it is bug #275304 or bug #275364 Those two seem closely related, aren't they? Both to each other and to this PR :)
(In reply to Mikhail T. from comment #29) > Ouch. Shouldn't it be? At present, the "out of the box" 14.x is unusable for people like myself :( You can write me an email to asiciliano@ as this PR is close and unrelated to portconfig, we can solve quickly the problem. >(In reply to Alfonso S. Siciliano from comment #28) > if it is bug #275304 or bug #275364 >Those two seem closely related, aren't they? Both to each other and to this PR :) Yes, the 2 PR (bug #275304 and bug #275364) are the same problem, that is `make config` in a NO-utf8 environment. The cause is described in their comments. However, they are not related to this PR. Actually this is a ncurses feature, env NCURSES_NO_UTF8_ACS, to know more review D42380.