-
-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Is there an existing issue for this?
- I have searched the existing issues
Midnight Commander version and build configuration
4.8.33, gitOperating system
LinuxIs this issue reproducible using the latest version of Midnight Commander?
- I confirm the issue is still reproducible with the latest version of Midnight Commander
How to reproduce
On the Linux virtual terminal (console), with UTF-8 locale, set F9 -> Options -> Layout -> Console output Output Lines to some positive value.
Run a command that prints some accented chars.
Notice that the accented letters are shown incorrectly.
mc queries the contents from cons.saver using the CONSOLE_CONTENTS commands in show_console_contents_linux. The 8-bit character from received data (in some ad-hoc encoding, probably a runtime "palette" approach) is then passed to tty_print_char() which expects a char accoding to the locale (practically Unicode).
We could probably fix it by reading /dev/vcsu* (the Unicode-aware counterpart of /dev/vcsa*, available since Linux 4.19, October 2018; but reading that file fails if the console is not in Unicode mode, so we'd have to retain a fallback).
But is it worth it?
In my opinion the Linux console is only suitable for emergency firefighting; for all purposes pretty much any graphical terminal emulator is vastly superior. I don't think mc should aim for having features that aren't available on graphical terminals.
Also, security/privacy-wise, it slightly worries me that setgid cons.saver offers the functionality of sending the console's contents to the invoker process. I wouldn't mind seeing this feature (Output Lines in the graphical Options dialog, as well as its backing CONSOLE_CONTENTS) gone.
Expected behavior
.
Actual behavior
.
Additional context
No response