cursive
cursive copied to clipboard
[BUG] - Garbled characters rendering under OpenBSD 7.1
Describe the bug
Compiling a Rust cursive application on OpenBSD gives a running executable but the on terminal rendering is garbled
To Reproduce
Build any cursive application and run it under OpenBSD.
Expected behavior
The characters used for the UI decoration should display properly.
Screenshots
Environment
-
OpenBSD 7.1
-
This bug seems independent of the used back-end.
-
locale LANG= LC_ALL= LC_* = "C"
-
export TERM=linux
-
cursive version used is "0.16.0" for compatibility with OpenBSD 7.1 rust toolchain.
Doing:
export LANG=en_US.UTF-8
combined with:
export TERM=linux
gives a less garbled interface:
Hi, and thanks for the report!
Cursive only supports utf8 locale. The default locale (or the C
locale) are not utf8 and not supported in general.
For your last example, is the en_US.UTF-8 locale properly built? What does locale -a
return?
Hi, thanks for the response.
I took a few screenshots of the 'locale -a' and 'locale -m' command on an OpenBSD box.
Still 'locale charmap' seems to be another unknown locale.
So the locale is correctly installed. Not sure what's going on.
Note: we had another locale issue with NetBSD some time ago: https://github.com/gyscos/cursive/issues/494.
I think @hrkfdn might be using openBSD, he may know how to get this to work.
- Did you try in a graphical terminal emulator, or just in the native terminal?
- Did you try one of the curses backends (ncurses, pancurses) and one of the rust-native backends (crossterm, termion)?
Using a Linux terminal emulator and ssh to the OpenBSD was giving the same result.
I tried the various cursive back-ends a while ago.
Setting LC_CTYPE=en_US.UTF-8 makes 'locale charmap' return UTF-8 but does not solve the rendering bug.
I tried again to SSH to an OpenBSD box running my cursive enabled code from a Linux machine with: export TERM=linux and export LC_CTYPE=en_US.UTF-8 and the rendering is fine.
Do you have a clue on how to fix this in the OpenBSD console ?
I think @hrkfdn might be using openBSD, he may know how to get this to work.
Hey, I don't think I've ever tried using ncspot/Cursive on the console. Only in terminal emulators and there it worked without issues. I'll have a look later to check if it works on my system.
EDIT: Same here with the same locales (pancurses-backend). I only tested with htop
and that rendered okay.
Hi,
Some follow-up:
With "export TERM=linux" and "export LC_CTYPE=en_US.UTF-8" on a real Linux terminal over SSH the rendering is correct.
This is still a bug but not a bug that affects me anymore.
Thanks !
I encountered this problem on a new installation of Arch Linux, where the en_US.UTF-8
locale was set in the environment variables, but not generated with locale-gen
, and doing that fixed the problem.
Perhaps it might be a good idea to add this into the documentation as a gotcha. I hadn't expected that the program's environment would affect it that much.