[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Should the readline *-meta flags reset when $LANG changes?
From: |
Alan Coopersmith |
Subject: |
Should the readline *-meta flags reset when $LANG changes? |
Date: |
Mon, 8 Aug 2022 16:14:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; SunOS i86pc; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 |
One of our users complained that bash-5.1 on Solaris 11.4, when started
with LANG=C does not allow Unicode input after changing LANG to a UTF-8
locale until bash is restarted.
I've confirmed this is the default behavior, but can be overridden by
manually changing the readline output-meta flag from off to on:
% env LANG=C bash
bash-5.1$ echo \360\237\220\233
π
bash-5.1$ setenv LANG en_US.UTF-8
bash: setenv: command not found
bash-5.1$ export LANG=en_US.UTF-8
bash-5.1$ echo \360\237\220\233
π
bash-5.1$ bash
bash-5.1$ echo π
π
bash-5.1$ exit
exit
bash-5.1$ echo \360\237\220\233
π
bash-5.1$ bind 'set output-meta on'
bash-5.1$ echo π
π
(In all cases, the bug character was pasted the same way in a GNOME terminal,
bash just displayed it differently in the input command line. Our user was
actually trying it with Chinese text, not emoji, but the results were the
same.)
The documentation specifies that for output-meta "The default is βoffβ, but
Readline will set it to βonβ if the locale contains eight-bit characters."
The convert-meta & input-meta options are similarly documented as locale
dependent.
But none of them say what is expected to happen when the locale changes
after initialization - is the behavior we're seeing expected or are these
variables supposed to be automatically updated when the locale changes?
--
-Alan Coopersmith- alan.coopersmith@oracle.com
Oracle Solaris Engineering - https://blogs.oracle.com/solaris
- Should the readline *-meta flags reset when $LANG changes?,
Alan Coopersmith <=
- Should the readline *-meta flags reset when $LANG changes?, Alan Coopersmith, 2022/08/09
- Re: Should the readline *-meta flags reset when $LANG changes?, Chet Ramey, 2022/08/09
- Re: Should the readline *-meta flags reset when $LANG changes?, Chet Ramey, 2022/08/09
- Re: Should the readline *-meta flags reset when $LANG changes?, Alan Coopersmith, 2022/08/09
- Re: Should the readline *-meta flags reset when $LANG changes?, Koichi Murase, 2022/08/09
- Re: Should the readline *-meta flags reset when $LANG changes?, Chet Ramey, 2022/08/10
- Re: Should the readline *-meta flags reset when $LANG changes?, Chet Ramey, 2022/08/10
- Re: Should the readline *-meta flags reset when $LANG changes?, Koichi Murase, 2022/08/10
- Re: Should the readline *-meta flags reset when $LANG changes?, Chet Ramey, 2022/08/11
- Re: Should the readline *-meta flags reset when $LANG changes?, Koichi Murase, 2022/08/11