;;;###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'."
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
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.
(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
(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.
"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)
(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))