-
-
Notifications
You must be signed in to change notification settings - Fork 370
Description
GRASS GIS should support, i.e., understand the environmental variable BROWSER. Many other tools use it to set web browser and GRASS GIS should too. These include webbrowser package from Python standard library, Google Earth, or man:
...The choice of browser is determined by the optional
browser argument if one is provided, by the $BROWSER environment variable, or
by a compile-time default if that is unset (usually lynx)...
There is now GRASS_HTML_BROWSER variable which lib/init/grass.py uses to get a browser required by the user. A conservative solution (not changing the API) is to just use it as an override of BROWSER and then use GRASS_HTML_BROWSER internally.
The tricky part is that in some cases, BROWSER can be multiple commands or paths (see the webbrowser package documentation).
Describe alternatives you've considered
- Not supporting it like right now and telling users to set additional variable for GRASS GIS.
- Making
GRASS_HTML_BROWSERonly internal variable and using onlyBROWSERin the interface. (This is easiest to implement. This and the following ones would need to be done before 8.0 release.) - Dropping the
GRASS_HTML_BROWSERvariable completely in favor ofBROWSER(in all code). (I think this would be actually pretty good unless somebody has some use case which requiresGRASS_HTML_BROWSER.) - Replacing any direct use of the browser by Python webbrowser package.
Additional context
This suggestion was originally made as a part of Trac ticket 3964 by @jidanni. See also Trac ticket 3957 on issues with the browser variable.