David Thompson:
 |I'm going to need help debugging this one. I'm thinking it might be a 
 |platform specific problem with IRIX and fork. Basically I have to 
 |spawn the web browser using a fork and maybe that isn't correct on 
 |IRIX.
 |
 |As for the second problem you note, is this only happening on the 
 |second time you try and view help? The first issue of a help, exec's 

Right.

 |a process with just the URL sent to the envvar. Then the next time it 
 |is called, it looks to see if the process id still exists--if so, 
 |then it sends the -remote -raise openURL(URL) to the process id. So 
 |in essence it should only open a web browser once unless you quit it. 
 |You could easily fix your script to just parse the command line and 
 |look only for the URL or we could do something different. Let me know 
 |what you think is best.

Hmm.  Ok, so the mods assume that DX starts the first browser instance.
The usual trick to avoid this assumption (with netscape) is:

    netscape -remote "openURL($url)" || (netscape "$url" &)

That is, let netscape find itself and tell the parent whether it's running
or not.  Perhaps something similar could be done.

But what if (as in my case) the command DX invokes isn't necessarily a
persistent PID, but a "kick the browser" script (e.g. so you can direct an
already-running browser instance)?  Then the process ID test fails the
second time around.  Also related to this, I notice that dxui isn't
wait()ing on its child, which is what's causing DX to think a browser it
invoked is still hanging around:

      |-+- 840792 /home/rhh/software/dx/dx/bin_sgi/startupui
      | \-+- 840822 /home/rhh/software/dx/dx/bin_sgi/dxui -kiosk -proc
      |   |-+- 840779 /bin/csh -f /home/rhh/software/dx/dx/bin/dxworke
      |   | \--- 840851 /home/rhh/software/dx/dx/bin_sgi/dxexec -r -p1
 -->  |   \--- 840925 <defunct> 

However, backing up a step, is the DX_WEB_BROWSER functionality intended to
be netscape-specific on UNIX?  I don't know whether the -remote -raise
openURL(<url>) command-line options are supported by all UNIX web browsers.

And FWIW, this is the same line of reasoning the Mutt (a mailer user agent)
developers went through when they discussed web browser hooks.  Ultimately
scripts like url_handler were the result, letting the user decide how they
wanted to handle URLs, with the application just providing a hook to invoke
these scripts (or browsers) in the background with a URL given on the
command line.

So I'd offer the suggestion that, on UNIX, DX might consider just doing the
robust software equivalent of this:

    system( "netscape -remote \"openURL($url)\" || (netscape \"$url\" &)" )

if support is limited to netscape, or this:

    system( "%s \"$url\" &", browser )

if any web browser should be supportable.

Randy

-- 
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711

Reply via email to