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

Re: Bug when $USERNAME is cyryllic



Maksim,

What UNIX are you using where that's a valid username? If Linux, what distribution?

Not disparaging it, just wondering. I agree that this is not how zsh should be behaving. Are other shells (e.g. bash, Korn, tcsh) behaving correctly?

In English, we call the script used in Russia, Ukraine, Belarus, and a few other countries (including most internal vassals of Russia, as well as Bulgaria, Serbia (sometimes), Montenegro, Mongolia, Tajikistan, and until recently Kazakhstan) to write their native languages "Cyrillic", not "Cyryllic". Your English spelling and grammar is otherwise entirely acceptable.

Le 1 octobre 2023 05:04:40 UTC, "Максим Щербаков" <herobrine135111@xxxxxxxxx> a écrit :
Hello, this is the first time I am using mailing lists, don't be mad at me if I do something wrong.
Sorry for errors, English is not my native language.


I found a bug in zsh:

If I add this line to the top of /etc/passwd (before the "root" line, also works with other UIDs):
Студент:x:0:0:root:/home/Студент:/usr/bin/zsh

After logging in as "root" (so environment will be good, as in this case "root" line is used for login), and running this commands:
mkdir -p '/home/Студент'
env -i LANG=C.UTF-8 zsh -fc 'cd; echo "$USERNAME | ${(%):-%n} | $LOGNAME"'

I will get:
�т��ент | Ст\M-Q\M-p\M-4ент | Студент

Instead of:
Студент | Студент | Студент

As we can see, $LOGNAME is fine, but $USERNAME and %n are bad.

-----------------------------

Also, probably related, zcompile don't work on cyryllic paths:
touch '/home/Студент/.zc/.zcompdump-5.9'
zcompile '/home/Студент/.zc/.zcompdump-5.9'

Results in:
zcompile: can't write zwc file: /home/Студент/.zc/.zcompdump-5.9.zwc

-- 
Ellenor Agnes Bjornsdottir (she)
sysadmin umbrellix.net
jabber: ellenor ~on~ umbrellix.net


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