GNU bug report logs - #24698
[TRAMP] NetBSD stty does not support tab0

Previous Next

Package: emacs;

Reported by: iquiw <iku.iwasa <at> gmail.com>

Date: Sat, 15 Oct 2016 02:22:02 UTC

Severity: normal

Tags: patch

Fixed in version 25.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24698 in the body.
You can then email your comments to 24698 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24698; Package emacs. (Sat, 15 Oct 2016 02:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to iquiw <iku.iwasa <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Oct 2016 02:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: iquiw <iku.iwasa <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [TRAMP] NetBSD stty does not support tab0
Date: Sat, 15 Oct 2016 11:20:38 +0900
Tramp sends "stty tab0 ..." to remote host in
`tramp-open-connection-setup-interactive-shell' function.

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.

[1] http://netbsd.gw.com/cgi-bin/man-cgi?stty++NetBSD-current
[2] http://man.openbsd.org/OpenBSD-current/man1/stty.1

Thanks in advance,
iku




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24698; Package emacs. (Mon, 17 Oct 2016 11:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 24698 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: iquiw <iku.iwasa <at> gmail.com>
Cc: 24698 <at> debbugs.gnu.org
Subject: Re: bug#24698: [TRAMP] NetBSD stty does not support tab0
Date: Mon, 17 Oct 2016 13:23:29 +0200
iquiw <iku.iwasa <at> gmail.com> writes:

> Tramp sends "stty tab0 ..." to remote host in
> `tramp-open-connection-setup-interactive-shell' function.

"tab0" is POSIX-like, see <https://mac-registration.web.alcatel-lucent.com/mac_list.php>.

> 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---




Added tag(s) patch. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Mon, 17 Oct 2016 11:28:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24698; Package emacs. (Tue, 18 Oct 2016 15:40:02 GMT) Full text and rfc822 format available.

Message #13 received at 24698 <at> debbugs.gnu.org (full text, mbox):

From: iquiw <iku.iwasa <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 24698 <at> debbugs.gnu.org
Subject: Re: bug#24698: [TRAMP] NetBSD stty does not support tab0
Date: Wed, 19 Oct 2016 00:38:44 +0900
On Mon, Oct 17, 2016 at 8:23 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> "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".
I see.

> The following patch (based on the development version of Tramp) should
> fix this. Could you, pls, check?
With the patch, I could connect to NetBSD (7.0.1), OpenBSD (6.0) and
FreeBSD (10.2) hosts.

Thanks,
iku




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Tue, 18 Oct 2016 18:50:01 GMT) Full text and rfc822 format available.

Notification sent to iquiw <iku.iwasa <at> gmail.com>:
bug acknowledged by developer. (Tue, 18 Oct 2016 18:50:02 GMT) Full text and rfc822 format available.

Message #18 received at 24698-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: iquiw <iku.iwasa <at> gmail.com>
Cc: 24698-done <at> debbugs.gnu.org
Subject: Re: bug#24698: [TRAMP] NetBSD stty does not support tab0
Date: Tue, 18 Oct 2016 20:49:34 +0200
Version: 25.2

iquiw <iku.iwasa <at> gmail.com> writes:

>> The following patch (based on the development version of Tramp) should
>> fix this. Could you, pls, check?
> With the patch, I could connect to NetBSD (7.0.1), OpenBSD (6.0) and
> FreeBSD (10.2) hosts.

Thanks for the check. I've pushed the patch to the emacs-25 branch,
slightly modified. Closing the bug.

> Thanks,
> iku

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Nov 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.