From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 6E2NHu6z2GWK9AAAqHPOHw:P1 (envelope-from ) for ; Fri, 23 Feb 2024 16:04:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 6E2NHu6z2GWK9AAAqHPOHw (envelope-from ) for ; Fri, 23 Feb 2024 16:04:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708700654; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=q/JsUwhvFxB4wcKuNrGaVru5fXTGSLdZbX3dw8L5XxY=; b=b+y7ZuSMUMAqLbO9yhXWTXQGtTHk44wdfMN/num/wi6CPD/lyoEyumKmsxFhJJef+vEFHq r57czxteAooLBcGe98iFEk9E63dRqJ0dZJwgFkDwBsLEr2HFzEc+u+t0GAEBftdGxTyIFA Ih4HXmiv1a4ZjcC8rY6h+hwh7p2YM9oRGwDUYUaQl6l9KknO6ZQ/Oa33B3vm5t8QNiykZo G4HaGh+dOqGDsvg5fwMRKFUSWWg/6U2zN1jwgzpnH7gP0/o/b/S+N26JRSV7DTZpOGK+uq bs7ij9oqMT+TFCL0BwlPKsxHrPkdv0W3vnmRKZqY3YnWvZs4+BuH4FUtDv+w0w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708700654; a=rsa-sha256; cv=none; b=r+Gl57OxSk/uQ/uIms39/suxEnWKDHPbI1mgqewGUOx93N1PDUYiZj8ORbIYAsdDGgv/r8 g8R8xPFPGgx9BYbytOfaaOi1R7iAEdOShq6XDo+L5WKF46Iehw4p7/ulVdvHsL72Cw2iJy nzeyJI9k6KcYkqdCXkNs9x0VyDvZu/udd98OBtBP4BStgACoYFPWaebowJmDMMyc5ApUt9 4QK9gIe/JlL4jY4gpCODCh6Zb9WZReG2oDztmaioT+2nqjwRsoanArE+nmKLXXksf0Xlfe eIFlw3IXL3G1p/rlyIjleKpLqmXrxsn4BFBGagDsExxHGqYQVU6hsDfGCv6nJg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2E3373730F for ; Fri, 23 Feb 2024 16:04:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdX5F-0007MQ-Qn; Fri, 23 Feb 2024 10:03:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdWvO-0000If-Hv; Fri, 23 Feb 2024 09:53:18 -0500 Received: from ns13.heimat.it ([46.4.214.66]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdWvM-0005dl-Rq; Fri, 23 Feb 2024 09:53:18 -0500 Received: from localhost (ip6-localhost [127.0.0.1]) by ns13.heimat.it (Postfix) with ESMTP id 06DE330081F; Fri, 23 Feb 2024 14:53:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at ns13.heimat.it Received: from ns13.heimat.it ([127.0.0.1]) by localhost (ns13.heimat.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QN7EPCyISJgn; Fri, 23 Feb 2024 14:53:11 +0000 (UTC) Received: from bourrache.mug.xelera.it (unknown [93.56.171.217]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ns13.heimat.it (Postfix) with ESMTPSA id 4FEA130081A; Fri, 23 Feb 2024 14:53:11 +0000 (UTC) Received: from roquette.mug.biscuolo.net (roquette [10.38.2.14]) by bourrache.mug.xelera.it (Postfix) with SMTP id DF7962ED14FE; Fri, 23 Feb 2024 15:53:10 +0100 (CET) Received: (nullmailer pid 6104 invoked by uid 1000); Fri, 23 Feb 2024 14:53:10 -0000 From: Giovanni Biscuolo To: help-gnu-emacs@gnu.org Cc: help-guix@gnu.org Subject: 29.1: tramp: use $SHELL environment variable to start remote shell? Organization: Xelera.eu Date: Fri, 23 Feb 2024 15:53:10 +0100 Message-ID: <87o7c75j1l.fsf@xelera.eu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=46.4.214.66; envelope-from=g@xelera.eu; helo=ns13.heimat.it X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.87 X-Spam-Score: -5.87 X-Migadu-Queue-Id: 2E3373730F X-TUID: U5pCl0fjaWJ9 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, please is it possible to start a remote shell (and vterm) using the program defined in the $SHELL env variable on the remote host? Alternatively, is there a way to automatically source a remote profile (e.g. .bash_profile) in the remote shell? Short story long (sorry for the long details)... I have this Emacs and TRAMP versions: =2D-8<---------------cut here---------------start------------->8--- (emacs-version) "GNU Emacs 29.1 (build 1, x86_64-unknown-linux-gnu, cairo version 1.16.0)" (tramp-version nil) "2.6.2.0" =2D-8<---------------cut here---------------end--------------->8--- Installed emacs-vterm version: 0.0.2-1.c3a3a23 If I open a remote directory in dired with TRAMP and then connect to a remote host with "M-x shell" or "M-x vterm", the default shell is /bin/sh I can later start my preferred shell with "$SHELL -l" so my shell profile (e.g. .bash_profile) is sourced and all is working as expected [1] I need my remote profile to be loaded because all hosts I manage have Guix [2] installed and all needed environment variables are set by the user profile; here is an example of a "M-x shell" remote connection to a guix host (foreign distro), the same holds for "M-x eshell": =2D-8<---------------cut here---------------start------------->8--- /ssh:local.biscuolo.anemone:/localhome/g/ #$ guix describe guix 3676e31 repository URL: https://git.savannah.gnu.org/git/guix.git commit: 3676e312aaf1ce10ed1d7844e871b54e04624098 /ssh:local.biscuolo.anemone:/localhome/g/ #$ $SHELL -l (anemone)g@anemone:~$ guix describe Generation 9 Apr 21 2021 09:23:33 (current) guix 13c4a37 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 13c4a377f5a2e1240790679f3d5643385b6d7635 =2D-8<---------------cut here---------------end--------------->8--- (as you can see, without proper environment guix is not able to run as it should) I know that I can customize the remote shell to use by: 1. use "C-u M-x shell" and specify the remote shell to use [3] 2. use connection related information [4] to customize "remote-shell" per-connection (via regexp) but 1. does not vork for vterm and 2. is too complicated for this use case, IMO. Ideally I would like both "M-x shell" and "M-x vterm" to just do "the right thing" and start a remote shell using the remote $SHELL environment variable. Any hint please? Happy hacking, Gio' [1] I mean, is working in the same way I get when connecting with any other terminal emulator [2] some on foreign distro, other on Guix System [3] /bin/bash on foreign distros, /run/current-system/profile/bin/bash on Guix System [4] https://www.gnu.org/software/emacs/manual/html_node/tramp/Predefined-co= nnection-information.html P.S.: yes, still not using eshell as I should! :-( =2D-=20 Giovanni Biscuolo Xelera IT Infrastructures --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJABAEBCgAqFiEERcxjuFJYydVfNLI5030Op87MORIFAmXYsVYMHGdAeGVsZXJh LmV1AAoJENN9DqfOzDkSReYP/iVZSTaBHh+UTIKHJsAzMscZ0dYrOU1FqYWKhBNq Bs+EZGangaLL1OSILnJ+q9+bLeox3NDULpC/Jn60Y+COT9IbKhLiBATiR14FuF/M X6uYbBqkVdM+TAXXlmqLiNL/0Pb8MOOsd4p1I8tKeqYu7kpkT3kBvcI1KKTJc/Ln MiBewdJrHUem8h+hvMk+ENc7eleLVUIWFZLFOU7TMQtCtwuIswWk+M+VYubeLXee NXOZg9pLSQLN8ur6mpr0xpFaS9vcQLS1hv+qmgBJf1sLih1wwHB23o9gVRmK/CrB 1bsWwRwkHpq/satTOvepg/gbnfYu+C5ctok8H//kWx4V5/hBtxOi54+WJJfbRJNt nEimsr3wNRE0eNb4L4H4uD/I5rSje03e4ShKZn7C40VLpfWfeCqxAeyfJziR5Hz+ umkzPDaRdgMkwolmqTIkogLePqLIvChY7191yDgcLQt/rCaRzW5pX0aZbWGoXY8/ bQ8IQSoLL9XW8Bq5dHNYXsVAlLv6osVhGdEmaK7CtQ11KCqBFsQlV/N5dwF+FTzV uvdvHZzPvRxu42jFDmT3XoK10G/pIrcdP/EhgNO0tu8Q+fo7TRikD9pyBgYTidRH rH0iAT61dZBj6Ssim/3knENntswUm255+0Cyx6nmziWW1EIbXjMva5Q6JbnRNBG0 3pZ5 =9gs2 -----END PGP SIGNATURE----- --=-=-=--