* 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