exa icon indicating copy to clipboard operation
exa copied to clipboard

exa does not read TZ in 0.10.1

Open fkarg opened this issue 2 years ago • 7 comments

It seems to me the issue from #453 (not reading the TZ variable) reoccurred. If not, please tell me if/what I can do.

Somehow this is doubly weird, as the fallback /etc/localtime does exist. See for yourself:

pars@artus ~/text_zeug (master)> exa -lahF
Unable to determine time zone: No such file or directory (os error 2)
Permissions Size User Date Modified Name
drwxr-xr-x     - pars 19 Mar 14:19  .git/
.rw-r--r--     0 pars 19 Mar 14:19  .git-blame-ignore-revs
...
    omitted
...

pars@artus ~/text_zeug (master)> echo $TZ
Europe/Berlin

pars@artus ~/text_zeug (master)> exa --version
exa - list files on the command-line
v0.10.1 [+git]
https://the.exa.website/

pars@artus ~> exa -lahF /etc/localtime 
Unable to determine time zone: No such file or directory (os error 2)
Permissions Size User Date Modified Name
lrwxrwxrwx    27 root 22 Mar 07:44  /etc/localtime -> /etc/zoneinfo/Europe/Berlin

OS: NixOS 21.11, installed exa through cargo

Configuration can be found at configs, machine is artus.

fkarg avatar Mar 23 '22 17:03 fkarg

Will be fixed by #867, probably. Do you have access to /usr/share/zoneinfo/Europe/Berlin?

ariasuni avatar Mar 24 '22 19:03 ariasuni

there's just bin in /usr

fkarg avatar Mar 26 '22 09:03 fkarg

Ah sorry I misread, on your machine /etc/localtime -> /etc/zoneinfo/Europe/Berlin, so exa needs to access /etc/zoneinfo, not /usr/share/zoneinfo.

ariasuni avatar Mar 26 '22 13:03 ariasuni

Well, it's like that:

lrwxrwxrwx    20 root 22 Mar 07:44  zoneinfo -> /etc/static/zoneinfo/

and

.r--r--r--  2.3k root  1 Jan  1970  /etc/zoneinfo/Europe/Berlin

but I can totally just cat/access them, no root required.

fkarg avatar Mar 26 '22 15:03 fkarg

Ah well yeah, the reason is very simple: exa reads TZ and if it’s a relative path, it checks only in /usr/share/zoneinfo/. Your problem can be fixed temporarily either by setting TZ to an absolute path, or unsetting it so that it fallbacks on /etc/localtime. And my PR will definitely fix that for good.

ariasuni avatar Mar 26 '22 17:03 ariasuni

Unsetting it would degrade usability of other tools -- would setting it to an absolute path have downsides?

fkarg avatar Mar 27 '22 08:03 fkarg

I don’t think so, it seems to be well supported by both glibc and musl, but I never used this feature, so I guess you should try and see if it causes any problem.

ariasuni avatar Mar 27 '22 19:03 ariasuni

Closing this, since exa is unmaintained (see https://github.com/ogham/exa/issues/1243), and this has (finally :tada:) fixed in the active fork eza!

ariasuni avatar Sep 11 '23 22:09 ariasuni