On Thu, Dec 02, 2010 at 11:23:37AM +0800, Grissiom wrote:
> A double check here is reasonable because if we launch a X-based browser in
> non-X environment, everything will fail, users will got confused.
> 
> But On my box(Slackware), there is no $XAUTHORITY at all... But I see a
> XDG_SESSION_COOKIE which might be present in every X session. I'm not
> familiar in this area so it's just my guessing.

i don't think the lack of any of those variables is an indicator for a
non-X environment. only DISPLAY should reliably be present if X is
available, but, even that is not proof enough that X is really
accessible. in screen for example i get my DISPLAY value frequently
wrong (because it is from a previous login) so the only real test is to
actually make a connection to the X server and see if it responds.

however, even then, using a gui browser only works if it is started from
the local machine. imagine the following scenario:

i log into a remote server, and have DISPLAY pointing back to my
desktop. on the desktop i run firefox. now on the server i invoke help.
it starts firefox, which connects to the X server and finds that there
is a firefox already running, so instead it will tell the desktop
firefox to open a new window. and now the catch: on my desktop i don't
have fish (for whatever reason, it could also be that the help pages are
in a different path) and firefox fails to open the page. 

fish help will never find out that opening the page failed.

so another check is needed, to open a gui browser only if the DISPLAY is
local. (this also helps speed up, i really would not want to wait for a
remote browser to come up on my desktop over a slow connection)

greetings, martin.
-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
services:   debugging, programming, training, linux sysadmin, web development
--
pike programmer      working in china                   community.gotpike.org
foresight developer  (open-steam|caudium).org              foresightlinux.org
unix sysadmin        iaeste.at                                     realss.com
Martin Bähr          http://www.iaeste.at/~mbaehr/               is.schon.org

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to