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

Re: mailcap configuration in zsh can't open .bk files



On Thu, 29 Aug 2013 19:59:18 -0700
Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> On 2013-08-30 at 09:12 +0800, vinurs wrote:
> > then in zsh, I can open pdf files, but ,when I mv test.pdf to test.pdf.bk,
> > It can not be opened.
> > I use file --mime-type test.pdf.bk, It shows:
> > test.pdf.bk: application/pdf
> 
> The `file` command looks inside the content of a file and uses a complex
> set of rules to try to figure out what sort of file it is.
> 
> The normal approach of MIME handling on Unix is to use the filename
> extension to figure out the type of file.  There are *two* files of
> interest: `mailcap` files say what to do with a MIME type, `mime.types`
> files say what MIME type should be assumed for a given extension.

Hmm... the zsh-mime-setup script is smart enough to get this right if
you specify pdf.bk in ~/.mime.types, e.g.

application/pdf pdf pdf.bk

but unfortunately the main shell isn't:  given the suffix alias pdf.bk,
it only looks for the .bk suffix, so the MIME handler isn't started.
This is probably fixable, although I'm not sure if it's strictly a bug.

If you were able to use a special suffix for this case, e.g. pdf_bk, it
would all work.

pws



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