From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Abutalib Aghayev Newsgroups: gmane.emacs.help Subject: Accessing emacsclient environment variables. Date: Sun, 06 Jul 2014 14:39:36 -0400 Message-ID: <874myu9trk.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1404686612 2153 80.91.229.3 (6 Jul 2014 22:43:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jul 2014 22:43:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 07 00:43:26 2014 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 1X3v9X-0002ZR-SQ for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Jul 2014 00:43:23 +0200 Original-Received: from localhost ([::1]:47336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3v9X-0007gb-7v for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Jul 2014 18:43:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3s1i-0005CU-96 for help-gnu-emacs@gnu.org; Sun, 06 Jul 2014 15:23:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3s1Z-0006fw-3J for help-gnu-emacs@gnu.org; Sun, 06 Jul 2014 15:23:06 -0400 Original-Received: from mail-qg0-x233.google.com ([2607:f8b0:400d:c04::233]:56337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3s1Y-0006fr-V2 for help-gnu-emacs@gnu.org; Sun, 06 Jul 2014 15:22:57 -0400 Original-Received: by mail-qg0-f51.google.com with SMTP id z60so2977997qgd.10 for ; Sun, 06 Jul 2014 12:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=7oFjRqv5W7IRX+UJ73qB0bm0AX0yDpZ5JYcR9CDz06k=; b=ptNkFepzSxgJVTFjdfS//DagOXxaKVN9NNZg+bQkm3fhK+tuUwpLt5srWUDM2/fU46 l6AgB3Uj4QI7VhsZ4jcMLTsRCK0Kg15+IEjvvCSchFW5XVfCW6SU23Cs3T9EmUVY4Ykm t5LLg040Xw5zJszon0iaGBQQI6dcbT1KmreFAjKsHpv969ilL2fHwYYJdpGlEWlmE4Up zIyzZhUjKPitkOXVC8nD7qRwYGjAOQVUmDJsfgaoQL/C/vRwaSeXvbJBRMpxi5kqxetQ xPKoVId70ZfwX/PosmQW14QIeTygd72L2hhesdMEfw27gYuOToEfQfvEyn+W0VA8MLWx YL9Q== X-Received: by 10.224.120.68 with SMTP id c4mr2189204qar.17.1404674576448; Sun, 06 Jul 2014 12:22:56 -0700 (PDT) Original-Received: from goedel (syrah.ccs.neu.edu. [129.10.110.48]) by mx.google.com with ESMTPSA id o8sm58252739qai.8.2014.07.06.12.22.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Jul 2014 12:22:56 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::233 X-Mailman-Approved-At: Sun, 06 Jul 2014 18:43:13 -0400 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:98554 Archived-At: Hi all, On machine "foo", I start emacs as a server using "emacs --daemon" and on machine "bar" I do remote editing by running "ssh -A foo emacsclient -c". The -A switch is to enable SSH Agent Forwarding. Now, when I run shell in emacsclient (M-x shell), the shell does not have SSH_AUTH_SOCKET properly set, which is normal, since emacs server was started locally and M-x shell uses server's environment to launch a shell. However, emacsclient has the correct SSH_AUTH_SOCKET value in its environment -- I can verify that by running "cat /proc/pid-of-emacs-client/environ". Is there a way of accessing emacsclient's environment variable or at least its process id, so that I could set SSH_AUTH_SOCKET before launching shell? Better yet, is there a simpler way to solve this problem? Thanks.