lynx doesn't behave correctly when downloading a file (such as tar and zip archives) that has a /etc/mailcap entry with a copiousoutput parameter, e.g. application/zip; unzip -l '%s'; nametemplate=%s.zip; copiousoutput I expect the file to be downloaded. Instead, the contents are listed on the terminal, but don't appear in the alternate screen[*] (which lynx uses), so that they are immediately erased. [*] when supported by the terminal, such as xterm. So, there are 2 problems: 1. lynx doesn't offer the choice to download the file (I don't know whether this is configurable, but giving the choice should be the default, like with other browsers). 2. If lynx wants to support the copiousoutput entries, it should get the results via a pipe. Note: lynx currently freeze for tar archives, but this is a bug in the tar mailcap entries (a Ctrl-C interrupts tar). I've reported the bug here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681302
this is a useful suggestion; per guidelines it should have been categorized as wishlist
this is a useful suggestion; per guidelines it should have been categorized as wishlist
This wishlist item may be more important than it seems as the bug also breaks the w3m text browser. More than once, I've left a huge download running and came back to find nothing but a list of files splatted to my screen. It just doesn't make sense that Debian's default method of handling archives is to show the table of contents and then discard the contents. Fortunately, a quick fix (at least for w3m) is easy. One can comment out the broken lines in /etc/mailcap: # It is better to not pretend to know how to deal with archives. #application/x-tar; /bin/tar tvf -; print=/bin/tar tvf - | print text/plain:-; copiousoutput #application/x-gtar; /bin/tar tvzf -; print=/bin/tar tvzf - | print text/plain:-; copiousoutput #application/zip; unzip -l '%s'; nametemplate=%s.zip; copiousoutput I'm sure there's a more correct fix, but I'd be surprised if this patch causes any problems.
This may cause problems when upgrading or removing packages. There may be alternate workarounds; see the mailcap.order(5) man page.
Yes, of course my suggestion is just a temporary fix. As soon as update-mime is rerun, /etc/mailcap is over written. The best fix would be if the unzip and tar packages did not come with mime entries in /usr/lib/mime/packages/. Unfortunately, it seems a local administrator has no way to make a permanent fix in Debian. The order of entries can be changed with mailcap.order, but that does not appear to do what we want, which is to remove all mailcap entries for the archive mimetypes. Please let me know if I am wrong about this.