From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil T. Dantam Newsgroups: gmane.emacs.help Subject: Re: Detachable shells in Emacs? Date: Fri, 07 Sep 2012 22:08:15 -0400 Message-ID: References: <87a9xiiklt.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1347071171 13376 80.91.229.3 (8 Sep 2012 02:26:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Sep 2012 02:26:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 08 04:26:14 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TAAkQ-000724-8k for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Sep 2012 04:26:14 +0200 Original-Received: from localhost ([::1]:58159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAAkN-0004SB-4I for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Sep 2012 22:26:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAAkG-0004RK-8C for help-gnu-emacs@gnu.org; Fri, 07 Sep 2012 22:26:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAAUo-00081R-KG for help-gnu-emacs@gnu.org; Fri, 07 Sep 2012 22:10:19 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAAUo-0007ql-Be for help-gnu-emacs@gnu.org; Fri, 07 Sep 2012 22:10:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TAAUl-0007F2-79 for help-gnu-emacs@gnu.org; Sat, 08 Sep 2012 04:10:03 +0200 Original-Received: from fastolfe.cc.gt.atl.ga.us ([143.215.129.86]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Sep 2012 04:10:03 +0200 Original-Received: from ntd by fastolfe.cc.gt.atl.ga.us with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Sep 2012 04:10:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: fastolfe.cc.gt.atl.ga.us In-Reply-To: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86692 Archived-At: > I work from home occasionally, and so I'd like to be able to leave > Emacs running at the office and resume working on it remotely, on my > laptop, over an ssh tunnel. But when I try to create a frame on my > laptop's display, using "localhost:10.0" as the display, I get "X11 > connection rejected because of wrong authentication." Likely, the XAUTHORITY used by emacs does not know how to talk to the X connection forward by ssh. I've had this problem when GDM makes some random XAUTHORITY file under /var, which emacs will also use, while SSH puts everything in ~/.Xauthority. The following script is what I use to forward emacs frames through SSH: #!/bin/sh #### Create a new emacs frame on $DISPLAY, setting xauthority properly ### Merge the xauth entry for $DISPLAY into emacs's xauthority # scrub out localhost from display, or xauth doesn't list it SCRUBBED_DISPLAY=`echo $DISPLAY | sed -e 's/^localhost:/:/'` if [ -n "$SCRUBBED_DISPLAY" ]; then CURRENT_XAUTH=`xauth list $SCRUBBED_DISPLAY` emacsclient -e "(shell-command \"xauth add $CURRENT_XAUTH\")" > /dev/null fi ### New emacs frame exec emacsclient -e "(make-frame-on-display \"$DISPLAY\")" -ntd