help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with X11 forwarding inside frame


From: Bob Proulx
Subject: Re: problems with X11 forwarding inside frame
Date: Tue, 14 May 2013 10:30:43 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

Joseph Mingrone wrote:
> phe is the local host, gly is the remote host.
> 
> From inside a term buffer: 
> 
> jrm@phe ~ % ssh -f gly 'env | grep -i display; emacsclient -nc'
> 0;jrm@phe|~DISPLAY=localhost:10.0
> emacsclient: can't find socket; have you started the server?
> ...
> Starting Emacs daemon.
> 
> So far so good.  The new frame from gly opens.

There are details missing.  The emacsclient -nc is reporting first
that it can't open the socket and probably included the next line
suggesting to use server-start to start a server.  But then something
else is "Starting Emacs daemon."  That isn't explained.

Something is setting your DISPLAY variable.  Did you configure your
ssh to ForwardX11 on every connection?  It isn't explained how DISPLAY
is getting set in the above.

> From inside a term buffer in the new frame from gly:
> jrm@gly ~ % xcalc
> Error: Can't open display: localhost:10.0

In order for X programs to connect to your display they will also look
at $XAUTHORITY or $HOME/.Xauthority to obtain the magic cookie
credentials to be able to connect.  This is in addition to $DISPLAY to
locate the communication socket.  If you just setting DISPLAY such as
in a .bashrc file then that will probably not be sufficient.

> This is isolated to emacs because I can open a remote terminal and X11
> forwarding works.
> jrm@phe ~ % ssh -f gly 'env | grep -i display; xterm'
> 0;jrm@phe|~DISPLAY=localhost:10.0

That opens an interactive shell.  There is a large opportunity for
differences there from the other non-interactive shell.

> jrm@gly ~ % xcalc # xcalc opens

First, I don't know.  I don't see enough information in the above to
diagnose it yet.  But I am guessing that in your .bashrc or .profile
that you are setting variables.  When you open a full terminal then
bash will run through all of the startup files which will be different
for an interactive shell than for a non-interactive shell.

> If I open a local terminal, ssh to gly, then start an emacsclient
> everything works fine.  Is there a way to avoid having a local terminal
> open for each remote emacs frame and have X11 forwarding work?

Normally I would open exactly one ssh connection with X11 forwarding.
Then I would start all of the X clients that I intend to start using
that one single connection.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]