bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should the readline *-meta flags reset when $LANG changes?


From: Koichi Murase
Subject: Re: Should the readline *-meta flags reset when $LANG changes?
Date: Wed, 10 Aug 2022 05:50:52 +0900

2022年8月10日(水) 2:07 Alan Coopersmith <alan.coopersmith@oracle.com>:
> >> Thanks for the report. The eight-bit settings are auto-set once, when
> >> readline is first called, but I'll see if it makes sense to change them
> >> on every call.
> >
> > It's fairly easy. I'll make the change for the next devel branch push and
> > bash-5.2-rc3.
>
> Thanks for the quick investigation!

Does it mean custom values of these readline variables will be lost
every time LANG or LC_{CTYPE,ALL} is changed even if a user or program
intentionally sets them up?

We often temporarily change LANG or LC_* to perform some binary
operations [such as counting the number of bytes of data and safely
removing trailing x from the result of $(command;printf x)]. If that
becomes to affect the user settings of readline variables, do we need
to save and restore these readline variables every time we touch LANG
or LC_*? This would become a serious overhead because it would
typically involve a subshell: save=$(bind -v).

Also, if these readline variables would be cleared every time, it
seems to me that these readline variables would be effectively
unconfigurable and would lose the point of their existence, or we
could not touch LANG or LC_* at all after the initial setup.

Is it possible to make three states of the readline variables,
`on/off/auto', and make `auto' the default, which determines the
behavior depending on the current locale? In this case, the actual
behavior on/off can be cached in another variable and can be updated
on the change of LANG/LC_* when the readline variable has the value
`auto'.

--
Koichi



reply via email to

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