From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#46466: 28.0.50; Tramp hangs with bad prompt even when using /bin/sh Date: Sun, 14 Feb 2021 15:37:29 +0100 Message-ID: <874kiebtqu.fsf@gmx.de> References: <6026c5a7.1c69fb81.20d04.54d1@mx.google.com> <87eehkbb74.fsf@gmx.de> <60280767.1c69fb81.2aa53.b38c@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24718"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46466@debbugs.gnu.org To: Erik Hetzner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 14 15:38:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBIXO-0006K3-RU for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Feb 2021 15:38:14 +0100 Original-Received: from localhost ([::1]:39336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBIXN-0003T7-UH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Feb 2021 09:38:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBIXC-0003Sv-M1 for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2021 09:38:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBIXC-0007AR-F5 for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2021 09:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lBIXC-0001XI-BY for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2021 09:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Feb 2021 14:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46466 X-GNU-PR-Package: emacs Original-Received: via spool by 46466-submit@debbugs.gnu.org id=B46466.16133134725888 (code B ref 46466); Sun, 14 Feb 2021 14:38:02 +0000 Original-Received: (at 46466) by debbugs.gnu.org; 14 Feb 2021 14:37:52 +0000 Original-Received: from localhost ([127.0.0.1]:35665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBIX2-0001Wu-0V for submit@debbugs.gnu.org; Sun, 14 Feb 2021 09:37:52 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:53727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBIX0-0001Wi-G2 for 46466@debbugs.gnu.org; Sun, 14 Feb 2021 09:37:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613313450; bh=ebFcK2FgZZs4tbelcoykB3A70XEP2jr3IGOdL1YCfTA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=O/8xIAJh76l0E1tPagBGWaw3f7eZFbxlLjpuzv5Xig7JKygTkiGyQFpIRXLYU03xM YatclN6QXl/U31hu5Ppa8tNSrrh87rbfNfVQgdtGltIpeleTl5gn6sgY/Z+StNni0J UJoPxmzGgihc1l4iHDQgWlT7HHnSjJtYHJAhwuhk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.41.7]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M7Jza-1lEaJi2mUe-007jdL; Sun, 14 Feb 2021 15:37:30 +0100 In-Reply-To: <60280767.1c69fb81.2aa53.b38c@mx.google.com> (Erik Hetzner's message of "Sat, 13 Feb 2021 09:07:50 -0800") X-Provags-ID: V03:K1:33/QMOUWq7LLaq5/1OrpMHKl5/2rmkEa0gYQqyHC+i0hXBVIjF4 02Uj9+R+J34a4UWKB64uCzrZFP64Tse4WxzUyEfocv48c0O1tP+pkdLshtlSMG+hsRANgqC 7re5hpVkXsMOxTg8Uu2C9Mdh4P/iXi3BubsUM/B37skCr+PbZKWFsD2p7+8Y88Id7m0atfM /aS+T0ONPouc5F7OCs59A== X-UI-Out-Filterresults: notjunk:1;V03:K0:0DV9gcRSsJE=:BtN0CwcrejcpJAZKYvphif qeqj1cdSX+zM/fdXEVqtxggSL7/zaGVn3pUaFeBvpwycCxDRP9M/zMgR4zKgHabW/3jqFh9YE c7isrPGJH5LBFwDbWL+h+3qn9KCXGNj2ny4daEl/wquvnVHBUZPHX0EG7htpFJN5T5PNaDgBK HMGxjDzLuglNtlcDGqiHYDITbAWJtN89gLge2Lge6eiYv79j93pr7KFJAhcmqp0zuJSsvsD2B ptX8pD7JtKgle+IVn7FNEyHAk4ztF51muWUav0UeBjrQ5uqQxdOrmcq2XAcur4FUTWdUwxc5r khp7+rWlOpKGcTnwxL0hYidT9LT4SX3KOrwVwGsjeSWLxVuC2bBo15TH/EmGWqMT820nk24Aq LtdC/Oe673RPhVEBgzrR/tsaN2UfUeKjDHQVLZtbGlqhrIVC6Ti1ANILdJvmHKPcS1J4kDsqR dARWPU72qAhJJJbGkGxsKq8ukHBwmgp/ZXq9GdrgPFXLAuNlO+91cfZ8/hCqo3qsuSqhjx5my 0pTVhWiM2M+IMa6tb3RjPJOGQRVqO3o7Rc5ngpA1ht4p6CReP57AA4jHnzHUhRpWZTo3ajxeq pxxSjcaXCLVni4jrpu0VioQIVENySEvihzq7t8U/EMJYU1Tw05f3jWynZ3bxVDOQWgxgj/N+0 72qqGAu6psk/8sxQP18o+3Pxw+Ok3Ayy6iHigQabsNUq1OeSV31KNNMzus/918M7CZOAHbbsP 5AO2n+7avcKe70cr5rbbHWMNZHgDNVSoWDROEunkd27VCcXnyXtqTYTUVRSqm0YsJTurRYYd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200008 Archived-At: Erik Hetzner writes: > Hi Michael, Hi Erik, >> What is /bin/sh, both locally and remote? In my case, running Fedora 33= , >> I see >> >> --8<---------------cut here---------------start------------->8--- >> # ls -l /bin/sh >> lrwxrwxrwx. 1 root root 4 Jul 27 2020 /bin/sh -> bash >> --8<---------------cut here---------------end--------------->8--- > > Good question, I should have mentioned that. I have tested this on > both debian and ubuntu, where /bin/sh is linked to dash > > $ ls -l /bin/sh > lrwxrwxrwx 1 root root 4 Dec 10 05:23 /bin/sh -> dash Hmm, this doesn't count then. You have reported, that .bash_profile was used for user "test". What is the default shell for that user? > As a follow up, I suspect that in some way this is expected behavior. > I see that the *sshx* connection method specifies the shell to run > when connecting, whereas the *ssh* connection method connects without > specifying a command, and therefore starts a default remote shell. "sshx" is for special cases, where the default values of "ssh" don't work. > This suggests a fix which turns out to works. The behavior is fixed, > for me, by adding `("-o" "RemoteCommand=3D'%l'")` to the list of > `tramp-login-args' for `tramp-methods' (see below). We cannot hijack the argument "RemoteCommand" by default. There are several reasons. - People might have own values for that argument. For example, on my QNAP NAS devices it isn't possible to use ssh out-of-the-box for scripting, because QNAP starts the "Console Management" program, which is in the way. In order to fix this, I have added for all my QNAP NAS devices the following line in the respective .ssh/config entries: RemoteCommand /bin/sh -noprofile -noediting -norc -i - If the RemoteCommand argument is set, it isn't possible any longer to use direct async processes in Tramp. See (info "(tramp) Remote processes= ") > It is also possible to set the PS1 value directly with this remote > command, e.g. `("-o" "RemoteCommand=3D'PS1=3D\"$ \" %l'")`, which might > provide even more safety against unusual prompts. Maybe, but this should be better done with the SetEnv argument. > Is this a patch that would be welcome? It would fix cases where users > had more elaborate prompts in their default shell and where /bin/sh > was a simpler shell (debian and ubuntu, at least). Unusual prompts are > more and more popular, but users to do not usually enable them for > /bin/sh. However, it might have effects that I am not aware of. As said, the patch cannot be applied as-is. However, I'm open for all proposals, because this is indeed a common problem users blame Tramp about= . > best, Erik Best regards, Michael.