all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: problems with X11 forwarding inside frame
Date: Tue, 14 May 2013 10:30:43 -0600	[thread overview]
Message-ID: <20130514163043.GA1763@hysteria.proulx.com> (raw)
In-Reply-To: <86d2stk2ph.fsf@gly.ath.cx>

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	other threads:[~2013-05-14 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 15:20 problems with X11 forwarding inside frame Joseph Mingrone
2013-05-14 16:30 ` Bob Proulx [this message]
2013-05-14 18:21   ` Joseph Mingrone
2013-05-14 19:52     ` Joseph Mingrone
2013-05-16  5:17       ` W. Greenhouse
2013-05-19  1:46         ` Joseph Mingrone
2013-05-17 23:31     ` Bob Proulx
     [not found] <mailman.25746.1368546463.855.help-gnu-emacs@gnu.org>
2013-05-19  8:38 ` J G Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130514163043.GA1763@hysteria.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.