bug-bash
[Top][All Lists]
Advanced

[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 14:48:01 -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]