From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#24698: [TRAMP] NetBSD stty does not support tab0 Date: Mon, 17 Oct 2016 13:23:29 +0200 Message-ID: <8737jvb4ni.fsf@gmx.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476703472 24966 195.159.176.226 (17 Oct 2016 11:24:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 11:24:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 24698@debbugs.gnu.org To: iquiw Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 17 13:24:26 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw61c-000443-F1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 13:24:12 +0200 Original-Received: from localhost ([::1]:60557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw61e-0006bv-GY for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 07:24:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw61Y-0006bn-3d for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 07:24:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw61S-0004z3-Hg for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 07:24:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw61S-0004yx-Do for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 07:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bw61S-0004gU-5E for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 07:24: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: Mon, 17 Oct 2016 11:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24698 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24698-submit@debbugs.gnu.org id=B24698.147670342117968 (code B ref 24698); Mon, 17 Oct 2016 11:24:02 +0000 Original-Received: (at 24698) by debbugs.gnu.org; 17 Oct 2016 11:23:41 +0000 Original-Received: from localhost ([127.0.0.1]:36110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw616-0004fj-Pz for submit@debbugs.gnu.org; Mon, 17 Oct 2016 07:23:41 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:53371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw614-0004fR-9C for 24698@debbugs.gnu.org; Mon, 17 Oct 2016 07:23:38 -0400 Original-Received: from detlef.gmx.de ([87.146.48.35]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MMoU7-1c2PXR1RNf-008bhJ; Mon, 17 Oct 2016 13:23:30 +0200 In-Reply-To: (iquiw's message of "Sat, 15 Oct 2016 11:20:38 +0900") X-Provags-ID: V03:K0:oqwxyNQSVHWa6Mhv5Ce6OJ6uUjQrvolUnsSDE06GFihc3dPHDPA zWT5sgHIcEha3BnvSxKRoAhZJZxwxUCoKjSnKwMW5vFpgm2cYDZhRTGi+j7zpBaCq5BZrjL 9iIWcWlf2TX4BXp9semcxN0QCjeHtNIZL1FUFuXy+pDA2o1AQR2pzWw3bwQpQRqOlA7rGRc DIjqJOju3ZYfitcwKIbdg== X-UI-Out-Filterresults: notjunk:1;V01:K0:RJmmeGlwSBs=:Z/NqUNCAEGDQxhfXMs0Z9v nHxb3e/kI5cyn2C0qsGE5HYmE7UL3qSWf8vZ7tQMJkhwhXcv9wCrc79yOkp1d5Tblz55luD/v 0+XuqZez0+8SNFpaiOYGBonPGGtTUyr1UR/Ilouj2R7vuVk4vDvDFkVwWiMsM47zDVFtkvkDi +Al1Kjuui9C0SmbVB6eILPD0B/Q7+f1d6NyMhhEYhkl++VdTwUB+ORdtyT3DF6Tmidg9aKu7c hY5P4Ka4wTQ/1kbsvBNK4fPXgCY580zThP7P29yYXM/SyJbol3OrGH38zxVFUPZ5fSxM/w7fR 9s7iODsP3n5on0VylIXQ8ZMq5WWKwdLbPm9n7VRaC41CMym6n6kO5SZbJdsOccw+o49RR/jBO duHF+W8ezcOKdi0d+Odlda6Wuu0YmXd5K30+PjWwU1HX3iSkpHJ/cO78UPFjAXjfNHDggGnsE rq8H/2WqN0kJWGGub/GHfKSNhfOn3y80h86MK5QLwDwDpNKcoPf9s0GVVvIY4cAjlw1OT/W/O 88scxUPma1CXD/6D7Nd/RzJEr2KAdy/ronbzfWPmC3FZ3o3jFq5U9WPrEAMUM3NfG4MVjY+xn 8mGaNE3XkMwemuyqHRw18xTBNa59a4Wxy1vMNVflvKZk7tDuaMIH4HSD9gYGKK5xl+9HmoXvl XNuoUkzlXYkskCaitO7j7Cs0V6Q9rVZltNorJY3lGTVUfogZhCKRuSfnfiSNbw7I5f+5iToVV 1yvnro31eqNaQXaTpBGHxdh4tdJFI/LkgPBcDsZz1bwTz+g7DVPee8g20AUBh29iHt/bbJMK 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: 208.118.235.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:124586 Archived-At: iquiw writes: > Tramp sends "stty tab0 ..." to remote host in > `tramp-open-connection-setup-interactive-shell' function. "tab0" is POSIX-like, see . > NetBSD stty does not support "tab0" [1], so the command fails. > As a result, Tramp hangs while connecting to NetBSD host. > > According to the manual [2], OpenBSD stty seems not support "tab0" too. > > Both supports "tabs" which does same as "tab0". > It seems "tabs" is supported in other implementations, such as Linux, > FreeBSD, macOS. "tabs" is a synonym for tab0, also mentioned in POSIX. But I have no idea whether the derived "tabs" argument is supported everywhere. Therefore, I'm reluctant to replace "tab0" blindly by "tabs". The following patch (based on the development version of Tramp) should fix this. Could you, pls, check? > Thanks in advance, > iku --8<---------------cut here---------------start------------->8--- *** /home/albinus/src/tramp/lisp/tramp-sh.el.~45897f8f340a07b89bc2f288dec2df0fbfda149e~ 2016-10-17 13:16:50.453196769 +0200 --- /home/albinus/src/tramp/lisp/tramp-sh.el 2016-10-17 13:07:37.470127598 +0200 *************** *** 4045,4054 **** (case-fold-search t)) (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-shell)) ! ;; Disable tab and echo expansion. (tramp-message vec 5 "Setting up remote shell environment") (tramp-send-command ! vec "stty tab0 -inlcr -onlcr -echo kill '^U' erase '^H'" t) ;; Check whether the echo has really been disabled. Some ;; implementations, like busybox of embedded GNU/Linux, don't ;; support disabling. --- 4045,4054 ---- (case-fold-search t)) (tramp-open-shell vec (tramp-get-method-parameter vec 'tramp-remote-shell)) ! ;; Disable echo expansion. (tramp-message vec 5 "Setting up remote shell environment") (tramp-send-command ! vec "stty -inlcr -onlcr -echo kill '^U' erase '^H'" t) ;; Check whether the echo has really been disabled. Some ;; implementations, like busybox of embedded GNU/Linux, don't ;; support disabling. *************** *** 4164,4173 **** (when (string-match "^IRIX64" (tramp-get-connection-property vec "uname" "")) (tramp-send-command vec "set +H" t)) ! ;; On BSD-like systems, ?\t is expanded to spaces. Suppress this. ! (when (string-match "BSD\\|Darwin" ! (tramp-get-connection-property vec "uname" "")) ! (tramp-send-command vec "stty -oxtabs" t)) ;; Set utf8 encoding. Needed for Mac OS X, for example. This is ;; non-POSIX, so we must expect errors on some systems. --- 4164,4174 ---- (when (string-match "^IRIX64" (tramp-get-connection-property vec "uname" "")) (tramp-send-command vec "set +H" t)) ! ;; Disable tab expansion. ! (if (string-match ! "BSD\\|Darwin" (tramp-get-connection-property vec "uname" "")) ! (tramp-send-command vec "stty tabs" t) ! (tramp-send-command vec "stty tab0" t)) ;; Set utf8 encoding. Needed for Mac OS X, for example. This is ;; non-POSIX, so we must expect errors on some systems. --8<---------------cut here---------------end--------------->8---