views:

202

answers:

3
+1  Q: 

ssh and window ids

I have a project to do in school which is baffeling me... I am SSHing into a Solaris computer in the computer lab from my own Debian box via

ssh -Y name@***.cs.<school>

I can get in just fine, and the X11 seems to be working also. However, this peticular project requires us to find the window id of a netscape window via xwininfo and use this information in the following command

netscape -id 0xa00029 -remote 'openFile(/path/to/html/file)'

Now, if this netscape is the only window I have open (other than xterm), the preceding command works just fine. However, if I have any other iceweasel windows open (regardless of the order in which I opened netscape/iceweasel) the command will forward to my iceweasel despite the facts that I'm running the command in my SSH session and the two windows have very different window ids.

All of this eventually has to go into a C program, but I can't even get it to work reliably manually!

Any ideas?

P.S. I just saw this that may help. When I SSHed via Cygwin/X using the same command, I get this error

Warning: No xauth data; using fake authentication data for X11 forwarding.

Not sure if this is important as I can still use X11 (aparently) perfectly.

Thanks.

P.P.S the -id switch is documented in the netscape man pages:

-id window-id
      Identifies an X window to receive -remote commands.  If
      you do not specify a window, the first window found is
      used.
+1  A: 

When you use ssh -Y, you're requesting that remote clients be forwarded to your local X server, with full permissions. The Netscape/Mozilla/Firefox/Iceweasel/Etc. remote protocol runs through the X server, so it'll be forwarded too.

http://www.mozilla.org/unix/remote.html documents the protocol, and mentions nothing about -id. Nor does a very quick look at the source (e.g., http://mxr.mozilla.org/seamonkey/source/widget/src/xremoteclient/XRemoteClient.cpp#202) look promising for there being an -id option.

derobert
A: 

I sat down to an actual machine to perform the same tests, and they all fail there too... I would open 2 netscape windows and try to direct the command to one at a time. The most recently opened one would work properly, but any command directed to the other one would be forwarded to the same window, so at this point I am convinced that the problem lies in the command being not properly implemented and/or everything on that system being really, really old.

Mike
A: 

if I have any other iceweasel windows open (regardless of the order in which I opened netscape/iceweasel) the command will forward to my iceweasel despite the facts that I'm running the command in my SSH session and the two windows have very different window ids

Iceweasel is coded that way. It tries to have only a single process run for all open windows for that user.

Use the -no-remote command line option to avoid it. See http://kb.mozillazine.org/Command_line_arguments

Marsh Ray