[vim/vim] Files with extension .tzst are handled differently from .tar.zst (#8105)

294 views
Skip to first unread message

Martin

unread,
Apr 14, 2021, 4:24:32 AM4/14/21
to vim/vim, Subscribed

Describe the bug
.tzst extension is an equivalent of .tar.zst, however, vim seems to handle them differently.

While it correctly opens .tar.zst as an archive, it seems to open .tzst as a file, thus mangling it.

Here's an example on two identical files named differently:

image

Environment (please complete the following information):
vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 26 2021 00:21:09)
Included patches: 1-2653
Compiled by Arch Linux

Terminal: Konsole


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Christian Brabandt

unread,
Apr 14, 2021, 4:54:15 AM4/14/21
to vim/vim, Subscribed

I think this needs a patch to $VIMRUNTIME/plugin/tar.vim Something like this:

diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim
index d55492a93..5fe459912 100644
--- a/runtime/plugin/tarPlugin.vim
+++ b/runtime/plugin/tarPlugin.vim
@@ -46,6 +46,7 @@ augroup tar
   au BufReadCmd   *.txz                        call tar#Browse(expand("<amatch>"))
   au BufReadCmd   *.tar.zst            call tar#Browse(expand("<amatch>"))
   au BufReadCmd   *.tzs                        call tar#Browse(expand("<amatch>"))
+  au BufReadCmd   *.tzst                       call tar#Browse(expand("<amatch>"))
 augroup END
 com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)

Actually, I wonder whether *.tzs was meant to mean *.tzst? ping @cecamp

cecamp

unread,
Apr 15, 2021, 1:34:29 PM4/15/21
to vim/vim, Subscribed

I can put it in, but I don't have *.tzs or *.tar.zst maps in tarPlugin.vim. I have no idea how they got there, nor whether *.tzs was a typo. Currently, until I get pure-ftp working, I cannot upload anything to my own website, so it'll be a bit before I get to uploading it. I'll have to leave it to you and the anonymous contributor that tar.vim handles these zst files acceptably.

cecamp

unread,
Apr 15, 2021, 1:34:30 PM4/15/21
to vim/vim, Subscribed

Closed #8105.

Martin

unread,
Apr 15, 2021, 1:47:08 PM4/15/21
to vim/vim, Subscribed

I don't have *.tzs or *.tar.zst maps in tarPlugin.vim

I have no idea how they got there

They are in master - https://github.com/vim/vim/blob/master/runtime/plugin/tarPlugin.vim#L47-L48

And apparently the change was introduced with this commit, which introduced .tar.zst and .tzs so it is definitely a typo.

23515b4

Bram Moolenaar

unread,
Apr 15, 2021, 2:27:04 PM4/15/21
to vim/vim, Subscribed


Charles wrote:

> I can put it in, but I don't have *.tzs or *.tar.zst maps in

> tarPlugin.vim. I have no idea how they got there, nor whether *.tzs
> was a typo.

I see tar.zst mentioned on stackoverflow.

tzs is probably short for tar-zstd, like tgz is short for tar-gzip.
But it might just be what someone came up with, no idea how often it is
actually used.

tzst finds tensorflow results, is that actually used somewhere for a
compressed tar file?


>Currently, until I get pure-ftp working, I cannot upload anything to my
>own website, so it'll be a bit before I get to uploading it. I'll have
>to leave it to you and the anonymous contributor that tar.vim handles
>these zst files acceptably.

Hmm, ftp support is deprecated in several places. Time to look for
something else?

--
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Martin

unread,
Apr 15, 2021, 2:47:59 PM4/15/21
to vim/vim, Subscribed

tzst finds tensorflow results?

It does not.
image

tzs is probably short for tar-zstd, like tgz is short for tar-gzip.

That's what tzst is, tzs is just a misspelling of that.

See the linked wikipedia article above, peazip, archiver and libarchive for good measure, they all use tzst.

cecamp

unread,
Apr 15, 2021, 3:07:49 PM4/15/21
to vim/vim, Subscribed

I have to use what the web service wants, which used to be ftp but now is pure-ftp. Pure-ftp encrypts the password, as I understand (whereas ftp does not).

The tar plugin also has to be made aware of how to decompress zst files. C0rn3j -- please send updates concerning plugins I maintain to me, not to github. I'll look into peazip.

Martin

unread,
Apr 15, 2021, 3:12:49 PM4/15/21
to vim/vim, Subscribed

The tar plugin also has to be made aware of how to decompress zst files.

As you can see on the screenshot, it ALREADY handles .tar.zst files just fine.
All this needs is an extension fixup.

Christian Brabandt

unread,
Apr 15, 2021, 3:14:09 PM4/15/21
to vim/vim, Subscribed

FWIW .zst is mentioned in #7343 and also #1232

> Am 15.04.2021 um 21:07 schrieb cecamp ***@***.***>:
>
> 

> I have to use what the web service wants, which used to be ftp but now is pure-ftp. Pure-ftp encrypts the password, as I understand (whereas ftp does not).
>
> The tar plugin also has to be made aware of how to decompress zst files. C0rn3j -- please send updates concerning plugins I maintain to me, not to github. I'll look into peazip.
>
> —
> You are receiving this because you commented.

Christian Brabandt

unread,
Apr 15, 2021, 3:21:06 PM4/15/21
to vim/vim, Subscribed

Oh and the RFC mentions this extension https://tools.ietf.org/html/rfc8478 section 6.1

> Am 15.04.2021 um 21:12 schrieb Martin ***@***.***>:
>
> 

> The tar plugin also has to be made aware of how to decompress zst files.
>
> As you can see on the screenshot, it ALREADY handles .tar.zst files just fine.
> All this needs is an extension fixup.
>
> —
> You are receiving this because you commented.

Martin

unread,
Apr 15, 2021, 3:42:01 PM4/15/21
to vim/vim, Subscribed

Just to add to this, not that I think it's needed - .tzs seems to be a script extension for TUGZip.

Bram Moolenaar

unread,
Apr 15, 2021, 4:03:17 PM4/15/21
to vim/vim, Subscribed

Yes, tar.zst is clearly the full name. The question is what the short name would be, like .tgz for .tar.gz

The reason .tgz is used is that there are systems that don't support two dots in a file name.
I'm not sure if there also is a three letter limit, like we used to have on FAT.

I cannot find any actual use of .tzs for a compressed tar file. Not sure if it is a typo or someone tried to use the three character limit, but it doesn't look like it's used.

Supporting .tzst would be useful for those systems that don't support two dots. We would then have to assume this is actually used, I have never seen one. It is mentioned on https://fileinfo.com/extension/tzst

Martin

unread,
May 5, 2021, 9:28:42 AM5/5/21
to vim/vim, Subscribed

Since we're in agreement that .tzs which is already there is wrong, and the other formats also use the shorthand, and various sites, libraries and wikipedia agree that the shorthand for zstd is .tzst, is there anything stopping #8109 from being accepted?

Or at least have this issue reopened, since it still is a problem.

I see that the PR failed a single test on macOS, but I am not sure if that was a fluke and rerunning the CI test will make it pass, or whether this actually breaks some test somehow.

Dominique Pellé

unread,
May 5, 2021, 10:25:56 AM5/5/21
to vim/vim, Subscribed

The question is what the short name would be, like .tgz for .tar.gz

*.tzst = *.tar.zst

Source: GNU tar manual.

=== BEGIN QUOTE https://www.gnu.org/software/tar/manual/tar.html#gzip ===
Suffix | Compression program
‘.gz’ | gzip
‘.tgz’ | gzip
‘.taz’ | gzip
‘.Z’ | compress
‘.taZ’ | compress
‘.bz2’ | bzip2
‘.tz2’ | bzip2
‘.tbz2’ | bzip2
‘.tbz’ | bzip2
‘.lz’ | lzip
‘.lzma’ | lzma
‘.tlz’ | lzma
‘.lzo’ | lzop
‘.xz’ | xz
‘.zst’ | zstd
‘.tzst’ | zstd
=== END QUOTE ===

Dominique Pellé

unread,
May 5, 2021, 10:35:58 AM5/5/21
to vim/vim, Subscribed

I should add: besides *.tzst, there are several other extensions in the gnu tar manual link I provided in my previous comment not supported by vim (e.g. *.taz, *.taZ, *tbz2, …). Some of them seem rarely used though. But the GNU tar manual is authoritative enough to support them.

Bram Moolenaar

unread,
May 5, 2021, 1:37:00 PM5/5/21
to vim/vim, Subscribed


> I should add: besides `*.tzst`, there are several other extensions in

> the gnu tar manual link I provided in my previous comment not
> supported by vim (e.g. `*.taz`, `*.taZ`, `*tbz2`, …). Some of them

> seem rarely used though. But the GNU tar manual is authoritative
> enough to support them.

You may want to ping Charles, I'm not sure if he reads the github messages.

--
A computer without Windows is like a fish without a bicycle.


/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Martin

unread,
Jun 1, 2021, 4:49:50 AM6/1/21
to vim/vim, Subscribed

@cecamp Could you please take a look at the #8109 PR that fixes this?

Reply all
Reply to author
Forward
0 new messages