From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable Date: Fri, 22 Mar 2019 15:13:16 +0100 Message-ID: <87tvfvatfn.fsf@gmx.de> References: <41148.0504948244$1553236696@news.gmane.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="58077"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34943@debbugs.gnu.org To: Shuguang Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 22 15:33:23 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7LEW-000Evo-Gu for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Mar 2019 15:33:20 +0100 Original-Received: from localhost ([127.0.0.1]:58257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7LEV-0004xF-8n for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Mar 2019 10:33:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7L43-00049i-QE for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2019 10:22:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7Kvr-0007KB-5p for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2019 10:14:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41022) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7Kvq-0007IN-CC for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2019 10:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h7Kvq-0005Lo-29 for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2019 10:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Mar 2019 14:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34943 X-GNU-PR-Package: emacs Original-Received: via spool by 34943-submit@debbugs.gnu.org id=B34943.155326401920532 (code B ref 34943); Fri, 22 Mar 2019 14:14:02 +0000 Original-Received: (at 34943) by debbugs.gnu.org; 22 Mar 2019 14:13:39 +0000 Original-Received: from localhost ([127.0.0.1]:54566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7KvS-0005L6-KO for submit@debbugs.gnu.org; Fri, 22 Mar 2019 10:13:38 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:53519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7KvN-0005Kr-St for 34943@debbugs.gnu.org; Fri, 22 Mar 2019 10:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1553263997; bh=KRrzPGs5oj2w+mi7+of/vG0FIC22A+9VO+XvOPCUQpI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=WrjFBESrcbCRcZkp2OGFq1GxFXLJHFxnPqDrDQtffUfxVoYmqvBpiKI5Q5tB71Ru2 NESbrDMj2Si5A1Lf/Kfg7GGh9FLKf0fLMpJDRgRxyrMHhhx40Nxm1kz4PxI3/9otSU xGwKLvip6WNNklQxcTWziocE0q/qQi/k08avMeIo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.86.60.108]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M4nt7-1gmVfs1k4r-00z06O; Fri, 22 Mar 2019 15:13:17 +0100 In-Reply-To: <41148.0504948244$1553236696@news.gmane.org> (Shuguang Sun's message of "Fri, 22 Mar 2019 14:17:25 +0800") X-Provags-ID: V03:K1:NK3Z90teZ7Ti8lyCCirwxCeWGnYi2oiv0G9oRzpO3PklHo3Pyvo Y7umYwQZ848hYNKk9BDsVW8kFEtd7r4l0DfjTvDQoJL5Y8fvte+ua6dHDkgLKOSXcH7joya 5eL9FTjKxMXAQYRZco2FgrVEaovAnZTZ+StGpHjWXV1oK3DF4rvpdZe5eMCv4MmYj79L8NZ ARoUeKpaT0WGvoDZAoVJg== X-UI-Out-Filterresults: notjunk:1;V03:K0:84dgQ6+xul4=:EoCA1+fE+qoN3cxBkKTcE6 dyWwEm2fzCXNE5MIYywGnrTYH+Qf4JG+lm3kVF9WUubuRWhmiokgBPeIDZIfn5lz+fB1MSSDV QPiSRj8Lbn0tgaWtV7+01GnZqNvAxjt273d46drKassoUfXRAMHhUh7+EJabv58y9g2xZfcDB 84hzuouePuWIVYqsl+pJoOApe34dPmeeSkNyANLLVlIWUbL0ZqQBUfZnsieMb1QSTG3mTtLNB yVBqLkoT6QdXrCSIFeFGIMdEEwrgYHI+j5PJu/QhL4yAm3cbmh9BZVkmlfBL5AwZFQ9Derbd1 +dh5ZCCoLSwlajJ1MxYCpHX5oTx3dMtCahTQSR6r6oojlD+cMlEv7VxHru3uicgPeOl0Al6hF 4GQ7VsIaWXWfYHIHPtNIintspb9kpSu/jxp7o+2B5TyNCYnAS5OuvFTMtZaFdWnbkRgYXEoX/ X1gQzNX3Ll5kdRKQOd7CF/6ja78YpL7vN/q3DlxkkPdOCe/vGcH60K78/pNbPgjrk/ae/y88i vCWePUr/egVxUKOHB5ypMR+MQbCICPULtY4bRgKHK6pMvs6y/F4UTICKUUc6yUeJEDflAhGQQ k4Uc8DjxtpIWTfdG5/1GRIa3w1/X7SLoBmZ4x3Rc4T3UsqnGBSbVdgYWpXvSy1ye2jt6ifM7F SJ4NqCZzAHmIu44eE9kl7064mRmcgP1hzCkj+D9RY7belpLgaQ03noLGSf6io45yisN1JsswI gLRhWL2Bw8ervD/RlQAbdlzVLiVw4RsYxemA0UL8Ae1zjnOb6HpDHLzxXq1g77AMVyYl/3mh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156616 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Shuguang Sun writes: > Hi, > The recent change to Tramp for shell/explict shell has break the remote = shell again. For example: > - Tramp to a host > - in a remote diretory, M-x shell > it raise the error message: env path/to/cmdproxy.exe can't be found > which looks tramp shell invoke the local shell, instead the remote she= ll > > I have the settings: > ``` > (connection-local-set-profile-variables > 'remote-bash > '((explicit-shell-file-name . "/bin/bash") > (explicit-bash-args . ("-i")) > )) > > (connection-local-set-profiles > '(:application tramp :protocol "plink" :user "user" :machine "host.co= m") > 'remote-bash) > ``` > In the previous version of tramp (about Feb), it will invoke the explici= t-shell-file-name, instead of local cmdproxy. If `explicit-shell-file-name' is given, it must have precedence. What about the following patch to master: --=-=-= Content-Type: text/x-diff Content-Disposition: inline Content-Transfer-Encoding: quoted-printable *** /tmp/ediffWyfTux 2019-03-22 15:09:52.065151959 +0100 =2D-- /home/albinus/src/emacs/lisp/shell.el 2019-03-22 15:09:35.080867417 = +0100 *************** *** 721,729 **** (current-buffer))) (with-current-buffer buffer ! (when (file-remote-p default-directory) ! ;; On remote hosts, the local `shell-file-name' might be useless. ! (with-connection-local-variables (if (and (called-interactively-p 'any) (null explicit-shell-file-name) (null (getenv "ESHELL"))) =2D-- 721,729 ---- (current-buffer))) (with-current-buffer buffer ! (with-connection-local-variables ! ;; On remote hosts, the local `shell-file-name' might be useless. ! (when (file-remote-p default-directory) (if (and (called-interactively-p 'any) (null explicit-shell-file-name) (null (getenv "ESHELL"))) *************** *** 732,757 **** (expand-file-name (read-file-name "Remote shell path: " default-directory shell-file-na= me ! t shell-file-name)))))))) ! ;; The buffer's window must be correctly set when we call comint ! ;; (so that comint sets the COLUMNS env var properly). ! (pop-to-buffer buffer) ! ;; Rain or shine, BUFFER must be current by now. ! (unless (comint-check-proc buffer) ! (let* ((prog (or explicit-shell-file-name ! (getenv "ESHELL") shell-file-name)) ! (name (file-name-nondirectory prog)) ! (startfile (concat "~/.emacs_" name)) ! (xargs-name (intern-soft (concat "explicit-" name "-args")))) ! (unless (file-exists-p startfile) ! (setq startfile (concat user-emacs-directory "init_" name ".sh")= )) ! (apply #'make-comint-in-buffer "shell" buffer prog ! (if (file-exists-p startfile) startfile) ! (if (and xargs-name (boundp xargs-name)) ! (symbol-value xargs-name) ! '("-i"))) ! (shell-mode))) buffer) ;;; Directory tracking =2D-- 732,757 ---- (expand-file-name (read-file-name "Remote shell path: " default-directory shell-file-na= me ! t shell-file-name)))))) ! ;; The buffer's window must be correctly set when we call comint ! ;; (so that comint sets the COLUMNS env var properly). ! (pop-to-buffer buffer) ! ;; Rain or shine, BUFFER must be current by now. ! (unless (comint-check-proc buffer) ! (let* ((prog (or explicit-shell-file-name ! (getenv "ESHELL") shell-file-name)) ! (name (file-name-nondirectory prog)) ! (startfile (concat "~/.emacs_" name)) ! (xargs-name (intern-soft (concat "explicit-" name "-args")= ))) ! (unless (file-exists-p startfile) ! (setq startfile (concat user-emacs-directory "init_" name ".s= h"))) ! (apply #'make-comint-in-buffer "shell" buffer prog ! (if (file-exists-p startfile) startfile) ! (if (and xargs-name (boundp xargs-name)) ! (symbol-value xargs-name) ! '("-i"))) ! (shell-mode))))) buffer) ;;; Directory tracking --=-=-= Content-Type: text/plain > Another issue, the emacs treat explicit-shell-file-name and explicit-bash-args as non-safe local variables and ask how to deal it (Y/N/! ...). > In the previous version of tramp (about Feb), it takes these two variables as safe which I think is reasonable because user sets it in tramp-way explicitely and it is only used in tramp only. I'll check when the first problem is solved. Best regards, Michael. --=-=-=--