Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] multibyte never set according to setopt/unsetopt output



> On 20/12/2023 16:04 GMT Mark J. Reed <markjreed@xxxxxxxxx> wrote:
> 
> 
> 5.9, running on macOS. zsh fires up with multibyte enabled by default, which is visible in the way it handles multibyte characters (e.g. x=ā; echo $#xshows 1). I can turn the option off, and the behavior changes (e.g. the same parameter has a length of 2). 
> 
> But `unsetopt` always shows `nomultibyte`, and `setopt` never shows `multibyte`, regardless of the actual setting.

You've fallen foul of the slightly odd way that options are shown by default.

The key phrase in the manual for setopt is "minimize the differences from
the default options".  Since multibyte is on by default, it's not a
difference.

You should find if you unset it, however, that it shows up in setopt
as "nomultibyte".  If it didn't (it does for me but I'm on a recent
unreleased version) that would indeed be a bug.

If you want this to be a bit more rational, try "setopt kshoptionprint"
which I use myself (except when trying out the above).  It's still a
bit quirky as it shows nomultibyte as off or on, i.e. it's still
trying to show you differences form the default.

I don't know of a "just show the **** options" option but it's possible
as a function...

pws




Messages sorted by: Reverse Date, Date, Thread, Author