Commit 30abcda5 authored by Michael Albinus's avatar Michael Albinus

Some Tramp fixes

* lisp/net/tramp.el (tramp-connectable-p):
* lisp/net/tramp-cache.el (tramp-list-connections):
* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled):
Bind `tramp-verbose' to 0.

* lisp/net/tramp-sh.el (tramp-remote-path, tramp-find-executable):
Fix docstring.
(tramp-open-shell): Read prompt when moving "~/.editrc".
parent ac6ba689
Pipeline #4762 passed with stage
in 63 minutes and 30 seconds
......@@ -411,15 +411,16 @@ used to cache connection properties of the local machine."
;;;###tramp-autoload
(defun tramp-list-connections ()
"Return all known `tramp-file-name' structs according to `tramp-cache'."
(let (result tramp-verbose)
(maphash
(lambda (key _value)
(when (and (tramp-file-name-p key)
(null (tramp-file-name-localname key))
(tramp-connection-property-p key "process-buffer"))
(push key result)))
tramp-cache-data)
result))
(let ((tramp-verbose 0)
result)
(maphash
(lambda (key _value)
(when (and (tramp-file-name-p key)
(null (tramp-file-name-localname key))
(tramp-connection-property-p key "process-buffer"))
(push key result)))
tramp-cache-data)
result))
(defun tramp-dump-connection-properties ()
"Write persistent connection properties into file `tramp-persistency-file-name'."
......
......@@ -2466,7 +2466,8 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
(when tramp-gvfs-enabled
;; Suppress D-Bus error messages and Tramp traces.
(let (tramp-gvfs-dbus-event-vector tramp-verbose fun)
(let ((tramp-verbose 0)
tramp-gvfs-dbus-event-vector fun)
;; Add completion functions for services announced by DNS-SD.
;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
(zeroconf-init tramp-gvfs-zeroconf-domain)
......
......@@ -491,8 +491,8 @@ The string is used in `tramp-methods'.")
For every remote host, this variable will be set buffer local,
keeping the list of existing directories on that host.
You can use `~' in this list, but when searching for a shell which groks
tilde expansion, all directory names starting with `~' will be ignored.
You can use \"~\" in this list, but when searching for a shell which groks
tilde expansion, all directory names starting with \"~\" will be ignored.
`Default Directories' represent the list of directories given by
the command \"getconf PATH\". It is recommended to use this
......@@ -3953,7 +3953,7 @@ hosts, or files, disagree."
First arg VEC specifies the connection, PROGNAME is the program
to search for, and DIRLIST gives the list of directories to
search. If IGNORE-TILDE is non-nil, directory names starting
with `~' will be ignored. If IGNORE-PATH is non-nil, searches
with \"~\" will be ignored. If IGNORE-PATH is non-nil, searches
only in DIRLIST.
Returns the absolute file name of PROGNAME, if found, and nil otherwise.
......@@ -4103,18 +4103,26 @@ file exists and nonzero exit status otherwise."
(with-tramp-progress-reporter
vec 5 (format-message "Opening remote shell `%s'" shell)
;; Find arguments for this shell.
(let ((extra-args (tramp-get-sh-extra-args shell)))
(let ((extra-args (tramp-get-sh-extra-args shell))
(p (tramp-get-connection-process vec)))
;; The readline library can disturb Tramp. For example, the
;; very recent version of libedit, the *BSD implementation of
;; readline, confuses Tramp. So we disable line editing. Since
;; $EDITRC is not supported on all target systems, we must move
;; ~/.editrc temporarily somewhere else. For bash and zsh we
;; have disabled this already during shell invocation, see
;; `tramp-sh-extra-args'. Bug#39399.
;; `tramp-sh-extra-args' (Bug#39399).
;; The shell prompt might not be set yet, so we must read any
;; prompt via `tramp-barf-if-no-shell-prompt'.
(unless extra-args
(tramp-send-command vec "rm -f ~/.editrc.tramp" t)
(tramp-send-command vec "mv -f ~/.editrc ~/.editrc.tramp" t)
(tramp-send-command vec "echo 'edit off' >~/.editrc" t))
(tramp-send-command vec "rm -f ~/.editrc.tramp" t t)
(tramp-barf-if-no-shell-prompt p 10 "Couldn't find remote shell prompt")
(tramp-send-command
vec "test -e ~/.editrc && mv -f ~/.editrc ~/.editrc.tramp" t t)
(tramp-barf-if-no-shell-prompt p 10 "Couldn't find remote shell prompt")
(tramp-send-command vec "echo 'edit off' >~/.editrc" t t)
(tramp-barf-if-no-shell-prompt
p 10 "Couldn't find remote shell prompt"))
;; It is useful to set the prompt in the following command
;; because some people have a setting for $PS1 which /bin/sh
;; doesn't know about and thus /bin/sh will display a strange
......@@ -4150,7 +4158,9 @@ file exists and nonzero exit status otherwise."
(tramp-shell-quote-argument tramp-end-of-output)
shell (or extra-args ""))
t)
;; Reset ~/.editrc.
(unless extra-args
(tramp-send-command vec "rm -f ~/.editrc" t)
(tramp-send-command
vec "test -e ~/.editrc.tramp && mv -f ~/.editrc.tramp ~/.editrc" t))
;; Check proper HISTFILE setting. We give up when not working.
......
......@@ -2555,7 +2555,7 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'."
"Check, whether it is possible to connect the remote host w/o side-effects.
This is true, if either the remote host is already connected, or if we are
not in completion mode."
(let (tramp-verbose
(let ((tramp-verbose 0)
(vec
(cond
((tramp-file-name-p vec-or-filename) vec-or-filename)
......@@ -3431,7 +3431,7 @@ User is always nil."
(with-tramp-progress-reporter v 0 (format "Opening directory %s" filename)
(let (ls-lisp-use-insert-directory-program start)
;; Silence byte compiler.
ls-lisp-use-insert-directory-program
(ignore ls-lisp-use-insert-directory-program)
(tramp-run-real-handler
#'insert-directory
(list filename switches wildcard full-directory-p))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment