[Alpine-info] Using mailcap to open RPM packages

Dag Wieers dag at wieers.com
Mon Mar 17 14:37:17 PDT 2008

On Thu, 13 Mar 2008, Dag Wieers wrote:

> I often get send SRPM packages that I need files from. That is why I was

> looking to open mc with it directly from pine. Normally this should work:


> mc "%s#rpm"


> so I added this to my ~/.mailcap file:


> application/x-rpm; mc "%s#r


> However, this does not work from Alpine, I get garbage on screen like this:


> Cannot get terminal settings: Inappropriate ioctl for device (25)

> ?[?1049h?[1;24r?[4l?[24;1H?[m?[37m?[40m?[m?[39;49m



> ?[?1049l

Ok, I found the solution for this and maybe this is useful to someone
else. My user ~/.mailcap file now looks like this:

### antiword
application/msword; antiword -t %s; copiousoutput

### cat
application/pgp-signature; cat %s; copiousoutput

### cdiff (needs coloroutput)
text/x-diff; cdiff %s; needsterminal
text/x-patch; cdiff %s; needsterminal

### elinks (needs input)
application/xhtml+xml; /usr/bin/elinks -force-html %s; needsterminal
text/html; /usr/bin/elinks -force-html %s; needsterminal

### mc (needs input)
application/x-7zip; /usr/bin/mc %s#u7z; needsterminal
application/x-bzip2; /usr/bin/mc %s#utar; needsterminal
application/x-gzip; /usr/bin/mc %s#utar; needsterminal
application/x-patch; /usr/bin/mc %s#patchfs; needsterminal
application/x-rpm; /usr/bin/mc %s#rpm/CONTENTS.cpio#ucpio; needsterminal
application/x-tar; /usr/bin/mc %s#utar; needsterminal
application/zip; /usr/bin/mc %s#zip; needsterminal

and it proved to be already immensly useful for handling eg. HTML email
and RPM packages as attachments. Since I am working on a remote system I
prefer not to open X applications.

Kind regards,
-- dag wieers, dag at wieers.com, http://dag.wieers.com/ --
[Any errors in spelling, tact or fact are transmission errors]

More information about the Alpine-info mailing list