- Package:
- ncurses-bin
- Source:
- ncurses
- Description:
- terminal-related programs and man pages
- Submitter:
- SDiZ
- Date:
- 2023-01-30 00:45:04 UTC
- Severity:
- normal
I am not sure is this a console-tools bug.. I have tried `/etc/init.d/console-screen.sh restart` I expect it would set all VT to utf-8 mode, but, in fact, it only set the current vt to unicode.. and `reset` resets the console to non-unicode mode..
retitle 239205 "reset changes a unicode console to non-unicode" reassign 239205 ncurses-bin thanks If the locale has charset UTF-8, and the VT is in unicode mode, then it should remain so after 'reset', and vice versa. Regards, Alastair
Reset just issues the terminal's standard reset sequence, \Ec\E]R for a Linux VT. The kernel chooses to clear the UTF-8 flag when it receives a reset sequence. If you don't want it to do that you'll have to discuss with the kernel maintainer.
Dé Déar, 2004-05-27 ag 09:53 -0400, scríobh Daniel Jacobowitz: reset, being a user-space program, knows that the terminal should be in UTF-8 mode if the locale says so; perhaps if the locale charmap is UTF-8, reset should send '\E%8' to put the VT into UTF-8 mode after issuing reset? Regards Alastair
Hmm, that I don't know. I'll defer to Thomas - Thomas, do you have an opinion on this? I guess it would be a change in reset's traditional behavior...
reset should do what the terminfo says. \E%8 looks too much like hardcoded behavior, since it doesn't appear in the terminfo. (You could define an extension, e.g., a boolean flag which is used consistently to tell what reset should do in this special case, but I'm afraid that Linux console is unique in this respect, so the extension would be useful only on Linux).
Are there really no other terminals which have a capability string to enter or exit UTF-8 mode? I suppose for xterm, you have to start it in UTF-8 mode or not. So maybe the Linux terminal really is unique in this respect. Not sure what to do w.r.t. the bug report. I'll think about it.
xterm can enter/exit via escape sequence, but a reset doesn't change the UTF-8 mode. A quick test seems to show gnome-terminal and konsole don't reset it either. (my copy of mlterm seems to have stopped working as a result of last week's upgrade, otherwise I'd comment on that too). on my to-do list I've got to check/see if there's an escape sequence that was overlooked.
btw, \E%8 is marked obsolete in the console_codes manpage (\E%G is the recommended one). Also bear in mind that people use 'linux' terminfo for remote connections. Changing behavior like this is a tradeoff between the sets of people you want to appease/annoy.
Going through some old bug reports…
Which would be rather undesirable anyway, at least in my opinion.
It also seems that the kernel's behavior (switching out of UTF-8 mode
when it receives a reset sequence) which caused the initial complaint
has changed, probably many years ago.
At least I am unable to reproduce the problem here with a 5.10 kernel
and am inclined to just close the bug.
Cheers,
Sven
It was fixed in 2007 (as a side-effect of a configuration parameter that was removed). See the "default_utf8" variable and reset_terminal() in https://github.com/torvalds/linux/commit/2e8ecb9db0bcc19e1cc8bb51e9252fe6a86a9863 https://github.com/torvalds/linux/commit/77bf2bab91e4e7df361963451c7b9a803516438c Before that change, it was not initialized (and false), so a \Ec would revert it to Latin-1.
It was fixed in 2007 (as a side-effect of a configuration parameter that was removed). See the "default_utf8" variable and reset_terminal() in https://github.com/torvalds/linux/commit/2e8ecb9db0bcc19e1cc8bb51e9252fe6a86a9863 https://github.com/torvalds/linux/commit/77bf2bab91e4e7df361963451c7b9a803516438c Before that change, it was not initialized (and false), so a \Ec would revert it to Latin-1.