unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: iquiw <iku.iwasa@gmail.com>
Cc: 24698@debbugs.gnu.org
Subject: bug#24698: [TRAMP] NetBSD stty does not support tab0
Date: Mon, 17 Oct 2016 13:23:29 +0200	[thread overview]
Message-ID: <8737jvb4ni.fsf@gmx.de> (raw)
In-Reply-To: <CAOAV1229uROz2i=9whe+cTWFSJyPFrVpimzVJJZ14zPfGxjLpA@mail.gmail.com> (iquiw's message of "Sat, 15 Oct 2016 11:20:38 +0900")

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





  reply	other threads:[~2016-10-17 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15  2:20 bug#24698: [TRAMP] NetBSD stty does not support tab0 iquiw
2016-10-17 11:23 ` Michael Albinus [this message]
2016-10-18 15:38   ` iquiw
2016-10-18 18:49     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737jvb4ni.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=24698@debbugs.gnu.org \
    --cc=iku.iwasa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).