1

I try to download a PDF file while browsing with lynx. Unfortunately, lynx tries to open that file immediately using a PDF viewer (evince) though I do not have an X server running.

How can I prevent lynx from doing that and have simply "download" the file instead?

1
  • There are several similar, text-mode browsers, called lynx, links, elinks. Sometimes I've seen them linked together (e.g., you install elinks and get programs called elinks, links, lynx) for backward compatibility. In any case, the documentation should answer your question.
    – vonbrand
    Commented Feb 4, 2016 at 20:07

2 Answers 2

0

You need to remove the line :
application/pdf; evince %s; test=test -n "$DISPLAY"; nametemplate=%s.pdf from /etc/mailcap. Lynx looks at the mailcap file for what to use when opening non-html.

0

Lynx uses a combination of the mime-types and mailcap configuration files to determine how to view a file. It does HTML (e.g., text/html) internally, as well as plain text files.

For anything else, it checks first what the mime-type is, and using that, looks in mailcap for the appropriate viewer:

  • In your Lynx configuration, you can have personal and global (system) mime-type extension maps.
  • In your Lynx configuration, you can have personal and global mailcaps, i.e., system.

Your personal mime-type and mailcaps are checked first, so you could override the behavior there, but downloading is done only when nothing is chosen. But you could set the global mime-type and mailcap files to something that you control directly. Modifying the system files tends to require intervention when you do upgrades.

You can always simply download whatever a link points to by using d (download) rather than Enter (activate). Even in downloading, you can have choices, which are configurable in lynx.cfg.

To see what keys are bound to different things, use k to show the Current Key Map.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .