unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24698: [TRAMP] NetBSD stty does not support tab0
@ 2016-10-15  2:20 iquiw
  2016-10-17 11:23 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: iquiw @ 2016-10-15  2:20 UTC (permalink / raw)
  To: 24698

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#24698: [TRAMP] NetBSD stty does not support tab0
  2016-10-15  2:20 bug#24698: [TRAMP] NetBSD stty does not support tab0 iquiw
@ 2016-10-17 11:23 ` Michael Albinus
  2016-10-18 15:38   ` iquiw
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2016-10-17 11:23 UTC (permalink / raw)
  To: iquiw; +Cc: 24698

iquiw <iku.iwasa@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---





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#24698: [TRAMP] NetBSD stty does not support tab0
  2016-10-17 11:23 ` Michael Albinus
@ 2016-10-18 15:38   ` iquiw
  2016-10-18 18:49     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: iquiw @ 2016-10-18 15:38 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 24698

On Mon, Oct 17, 2016 at 8:23 PM, Michael Albinus <michael.albinus@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#24698: [TRAMP] NetBSD stty does not support tab0
  2016-10-18 15:38   ` iquiw
@ 2016-10-18 18:49     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2016-10-18 18:49 UTC (permalink / raw)
  To: iquiw; +Cc: 24698-done

Version: 25.2

iquiw <iku.iwasa@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-18 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-15  2:20 bug#24698: [TRAMP] NetBSD stty does not support tab0 iquiw
2016-10-17 11:23 ` Michael Albinus
2016-10-18 15:38   ` iquiw
2016-10-18 18:49     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).