Exported variables are visible to child processes. If you don't need to
specifically export a variable for it be used by a child process it
means it has already been exported before.
You can verify by starting a new bash session and examining value of
BROWSER:
env | grep ^BROWSER=
Notice also that on Linux and possibly Cywin some programs will use xdg-open to open a web browser or simply hard-code a browser to firefox. I have verified that xpdf version 4.05 on my Linux system indeed uses
xdg-open using strace -f xpdf sed.pdf. It prints a lot of output and
makes xpdf much slower but if you press the link you'll see:
[pid 32675] execve("/usr/bin/xdg-open", ["/usr/bin/xdg-open", "https://en.wikipedia.org/wiki/Qu"...], 0x7ffc65f08a30 /* 65 vars */ <unfinished ...>
This part of xpdf manpage is outdated but it's also not so simple:
Clicking on a hyperlink will jump to the link's destination. A link
to another PDF document will make xpdf load that document. A ´launch'
link to an executable program will display a dialog, and if you click
´ok', execute the program. URL links are opened in a system-dependent
way. (On UNIX, Qt uses the $BROWSER environment variable.)
xdg-open indeed uses BROWSER in some places:
$ grep -F '$BROWSER' "$(command -v xdg-open)"
for browser in $BROWSER; do
if [ -n "$BROWSER" ]; then
if [ x"$BROWSER" = x"" ]; then
BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:$BROWSER
BROWSER="$(echo "$BROWSER" | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g')"
But it's a complex script, doing various things on different window
and desktop managers. I use i3 and here value of $BROWSERE is not
taken into account by xdg-open and it always exits in
open_generic().
You can use this to find what will be picked by xdg-open for a given
type:
$ XDG_UTILS_DEBUG_LEVEL=10 xdg-mime query default x-scheme-handler/https
Checking /home/ja/.config/mimeapps.list
userapp-Firefox-9Y4BR2.desktop
xpdf manpage could be updated to say that it uses xdg-open, it would
clear all confusion.
BROWSER=firefox pdfor did you doBROWSER=firefoxand then on the next linexpdf.firefoxin myPATH, which includes~/bin. I never hadfirefox.exein~/binbefore today. Today, as I was trying to getxpdfto open URLs, I symbolically linked~/bin/firefox.exeto the/c/Program Files/Mozilla Firefox/firefox.exe. Just now, I found that an oldxpdfprocess follows links even though it was launched before I started to experiment with setting BROWSER. It stopped following links when I renamed~/bin/firefox.exe.xpdfto follow links.