]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-sh.el
* net/tramp-sh.el (tramp-sh-handle-insert-directory): Add
[gnu-emacs] / lisp / net / tramp-sh.el
index 65a514c8e366d6e04712b957c6eca928b6403f37..e2aaafb38dd7318b4d932e80ddf2e8361e10944b 100644 (file)
@@ -109,31 +109,15 @@ detected as prompt when being sent on echoing hosts, therefore.")
     (tramp-copy-keep-date       t)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
- '("scp"
-   (tramp-login-program        "ssh")
-   (tramp-login-args           (("-l" "%u") ("-p" "%p")        ("-e" "none") ("%h")))
-   (tramp-async-args           (("-q")))
-   (tramp-remote-shell         "/bin/sh")
-   (tramp-remote-shell-args    ("-c"))
-   (tramp-copy-program         "scp")
-   (tramp-copy-args            (("-P" "%p") ("-p" "%k")        ("-q") ("-r")))
-   (tramp-copy-keep-date       t)
-   (tramp-copy-recursive       t)
-   (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
-                               ("-o" "UserKnownHostsFile=/dev/null")
-                               ("-o" "StrictHostKeyChecking=no")))
-   (tramp-default-port         22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
-  '("scp1"
+  '("scp"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
-                                ("-1") ("-e" "none") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
+    (tramp-copy-args            (("-P" "%p") ("-p" "%k") ("-q") ("-r") ("%c")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -142,15 +126,16 @@ detected as prompt when being sent on echoing hosts, therefore.")
     (tramp-default-port         22)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("scp2"
+  '("scp1"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
-                                ("-2") ("-e" "none") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-1") ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
+    (tramp-copy-args            (("-1") ("-P" "%p") ("-p" "%k")
+                                ("-q") ("-r") ("%c")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -159,19 +144,16 @@ detected as prompt when being sent on echoing hosts, therefore.")
     (tramp-default-port         22)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("scpc"
+  '("scp2"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
-                                ("-o" "ControlPath=%t.%%r@%%h:%%p")
-                                ("-o" "ControlMaster=yes")
-                                ("-e" "none") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-2") ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-P" "%p") ("-p" "%k") ("-q") ("-r")
-                                ("-o" "ControlPath=%t.%%r@%%h:%%p")
-                                ("-o" "ControlMaster=auto")))
+    (tramp-copy-args            (("-2") ("-P" "%p") ("-p" "%k")
+                                ("-q") ("-r") ("%c")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -182,14 +164,14 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("scpx"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
-                                ("-e" "none") ("-t" "-t")
-                                ("%h") ("/bin/sh")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "scp")
-    (tramp-copy-args            (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
+    (tramp-copy-args            (("-P" "%p") ("-p" "%k")
+                                ("-q") ("-r") ("%c")))
     (tramp-copy-keep-date       t)
     (tramp-copy-recursive       t)
     (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -200,42 +182,25 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("sftp"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
-    (tramp-copy-program         "sftp")))
-;;;###tramp-autoload
+    (tramp-copy-program         "sftp")
+    (tramp-copy-args            ("%c"))))
+ ;;;###tramp-autoload
 (add-to-list 'tramp-methods
   '("rsync"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
-    (tramp-async-args           (("-q")))
-    (tramp-remote-shell         "/bin/sh")
-    (tramp-remote-shell-args    ("-c"))
-    (tramp-copy-program         "rsync")
-    (tramp-copy-args            (("-e" "ssh") ("-t" "%k") ("-r")))
-    (tramp-copy-keep-date       t)
-    (tramp-copy-keep-tmpfile    t)
-    (tramp-copy-recursive       t)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
-  `("rsyncc"
-    (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
-                                ("-o" "ControlPath=%t.%%r@%%h:%%p")
-                                ("-o" "ControlMaster=yes")
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
                                 ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "rsync")
     (tramp-copy-args            (("-t" "%k") ("-r")))
-    (tramp-copy-env             (("RSYNC_RSH")
-                                (,(concat
-                                   "ssh"
-                                   " -o ControlPath=%t.%%r@%%h:%%p"
-                                   " -o ControlMaster=auto"))))
+    (tramp-copy-env             (("RSYNC_RSH") ("ssh" "%c")))
     (tramp-copy-keep-date       t)
     (tramp-copy-keep-tmpfile    t)
     (tramp-copy-recursive       t)))
@@ -257,7 +222,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("ssh"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
@@ -269,7 +235,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("ssh1"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
                                 ("-1") ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
@@ -282,7 +248,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("ssh2"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
                                 ("-2") ("-e" "none") ("%h")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
@@ -295,9 +261,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("sshx"
     (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p")
-                                ("-e" "none") ("-t" "-t")
-                                ("%h") ("/bin/sh")))
+    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
+                                ("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
     (tramp-async-args           (("-q")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
@@ -473,21 +438,14 @@ detected as prompt when being sent on echoing hosts, therefore.")
      (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function "scpc" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function
-      "rsyncc" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function
-      "ssh1_old" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function
-      "ssh2_old" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
       "telnet" tramp-completion-function-alist-telnet)
@@ -538,6 +496,7 @@ as given in your `~/.profile'."
                  (const :tag "Private Directories" tramp-own-remote-path)
                  (string :tag "Directory"))))
 
+;;;###tramp-autoload
 (defcustom tramp-remote-process-environment
   `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C"
     ,(format "TERM=%s" tramp-terminal-type)
@@ -988,8 +947,7 @@ This is used to map a mode number to a permission string.")
     (set-file-selinux-context . tramp-sh-handle-set-file-selinux-context)
     (file-acl . tramp-sh-handle-file-acl)
     (set-file-acl . tramp-sh-handle-set-file-acl)
-    (vc-registered . tramp-sh-handle-vc-registered)
-    (inotify-add-watch . tramp-sh-handle-inotify-add-watch))
+    (vc-registered . tramp-sh-handle-vc-registered))
   "Alist of handler functions.
 Operations not mentioned here will be handled by the normal Emacs functions.")
 
@@ -1331,7 +1289,8 @@ target of the symlink differ."
     (let ((f (buffer-file-name))
          coding-system-used)
       (with-parsed-tramp-file-name f nil
-       (let* ((attr (file-attributes f))
+       (let* ((remote-file-name-inhibit-cache t)
+              (attr (file-attributes f))
               ;; '(-1 65535) means file doesn't exists yet.
               (modtime (or (nth 5 attr) '(-1 65535))))
          (when (boundp 'last-coding-system-used)
@@ -1435,7 +1394,7 @@ of."
              (utc (not (featurep 'xemacs))))
          (tramp-send-command-and-check
           v (format "%s touch -t %s %s"
-                    (if utc "TZ=UTC; export TZ;" "")
+                    (if utc "env TZ=UTC" "")
                     (if utc
                         (format-time-string "%Y%m%d%H%M.%S" time t)
                       (format-time-string "%Y%m%d%H%M.%S" time))
@@ -2299,7 +2258,7 @@ The method used must be an out-of-band method."
         (t2 (tramp-tramp-file-p newname))
         (orig-vec (tramp-dissect-file-name (if t1 filename newname)))
         copy-program copy-args copy-env copy-keep-date port spec
-        source target)
+        options source target)
 
     (with-parsed-tramp-file-name (if t1 filename newname) nil
       (if (and t1 t2)
@@ -2367,9 +2326,11 @@ The method used must be an out-of-band method."
              user (or user "")
              port (or port "")
              spec (format-spec-make
-                   ?h host ?u user ?p port
                    ?t (tramp-get-connection-property
-                       (tramp-get-connection-process v) "temp-file" "")
+                       (tramp-get-connection-process v) "temp-file" ""))
+             options (format-spec tramp-ssh-controlmaster-options spec)
+             spec (format-spec-make
+                   ?h host ?u user ?p port ?c options
                    ?k (if keep-date " " ""))
              copy-program (tramp-get-method-parameter
                            method 'tramp-copy-program)
@@ -2419,7 +2380,7 @@ The method used must be an out-of-band method."
                 v "process-buffer" (current-buffer))
                (while copy-env
                  (tramp-message
-                  orig-vec 5 "%s=\"%s\"" (car copy-env) (cadr copy-env))
+                  orig-vec 6 "%s=\"%s\"" (car copy-env) (cadr copy-env))
                  (setenv (pop copy-env) (pop copy-env)))
 
                ;; Use an asynchronous process.  By this, password can
@@ -2631,10 +2592,13 @@ This is like `dired-recursive-delete-directory' for Tramp files."
        (if full-directory-p "yes" "no"))
       ;; If `full-directory-p', we just say `ls -l FILENAME'.
       ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
+      ;; "--dired" returns byte positions.  Therefore, the file names
+      ;; must be encoded, which is guaranteed by "LC_ALL=en_US.utf8
+      ;; LC_CTYPE=''".
       (if full-directory-p
          (tramp-send-command
           v
-          (format "%s %s %s 2>/dev/null"
+          (format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
                   (tramp-get-ls-command v)
                   switches
                   (if wildcard
@@ -2650,7 +2614,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
          (tramp-run-real-handler 'file-name-directory (list localname))))
        (tramp-send-command
         v
-        (format "%s %s %s"
+        (format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
                 (tramp-get-ls-command v)
                 switches
                 (if (or wildcard
@@ -2696,6 +2660,11 @@ This is like `dired-recursive-delete-directory' for Tramp files."
          (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
            (replace-match "")))
 
+       ;; Decode the output, it could be multibyte.
+       (decode-coding-region
+        beg (point-max)
+        (or file-name-coding-system default-file-name-coding-system))
+
        ;; The inserted file could be from somewhere else.
        (when (and (not wildcard) (not full-directory-p))
          (goto-char (point-max))
@@ -2809,7 +2778,11 @@ the result will be a local, non-Tramp, filename."
           (or (null program) tramp-process-connection-type))
          (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
          (name1 name)
-         (i 0))
+         (i 0)
+         ;; We do not want to raise an error when
+         ;; `start-file-process' has been started several time in
+         ;; `eshell' and friends.
+         (tramp-current-connection nil))
 
       (unless buffer
        ;; BUFFER can be nil.  We use a temporary buffer.
@@ -2856,10 +2829,12 @@ the result will be a local, non-Tramp, filename."
                         v 'file-error
                         "pty association is not supported for `%s'" name))))
                  (let ((p (tramp-get-connection-process v)))
-                   ;; Set query flag for this process.  We ignore errors,
-                   ;; because the process could have finished already.
+                   ;; Set query flag and process marker for this
+                   ;; process.  We ignore errors, because the process
+                   ;; could have finished already.
                    (ignore-errors
-                     (tramp-compat-set-process-query-on-exit-flag p t))
+                     (tramp-compat-set-process-query-on-exit-flag p t)
+                     (set-marker (process-mark p) (point)))
                    ;; Return process.
                    p))))
 
@@ -3488,64 +3463,6 @@ Fall back to normal file name handler if no Tramp handler exists."
         ;; Default file name handlers, we don't care.
         (t (tramp-run-real-handler operation args)))))))
 
-(defun tramp-sh-handle-inotify-add-watch (file-name aspect callback)
-  "Like `inotify-add-watch' for Tramp files."
-  (setq file-name (expand-file-name file-name))
-  (unless (consp aspect) (setq aspect (cons aspect nil)))
-  (with-parsed-tramp-file-name file-name nil
-    (let* ((default-directory (file-name-directory file-name))
-          (command (tramp-get-remote-inotifywait v))
-          (aspect (mapconcat
-                   (lambda (x)
-                     (replace-regexp-in-string "-" "_" (symbol-name x)))
-                   aspect ","))
-          (p (and command
-                  (start-file-process
-                   "inotifywait" nil command "-mq" "-e" aspect localname))))
-      (when (processp p)
-       (tramp-compat-set-process-query-on-exit-flag p nil)
-       (set-process-filter p 'tramp-sh-inotify-process-filter)
-       (tramp-set-connection-property p "inotify-callback" callback)
-       ;; Return the file-name vector as watch-descriptor.
-       (tramp-set-connection-property p "inotify-watch-descriptor" v)))))
-
-(defun tramp-sh-inotify-process-filter (proc string)
-  "Read output from \"inotifywait\" and add corresponding inotify events."
-  (tramp-message
-   (tramp-get-connection-property proc "vector" nil) 6
-   (format "%s\n%s" proc string))
-  (dolist (line (split-string string "[\n\r]+" 'omit-nulls))
-    ;; Check, whether there is a problem.
-    (unless
-       (string-match
-        "^[^[:blank:]]+[[:blank:]]+\\([^[:blank:]]+\\)+\\([[:blank:]]+\\([^[:blank:]]+\\)\\)?[[:blank:]]*$" line)
-      (tramp-error proc 'filewatch-error "%s" line))
-
-    (let* ((object
-           (list
-            (tramp-get-connection-property
-             proc "inotify-watch-descriptor" nil)
-            ;; Aspect symbols.  We filter out MOVE and CLOSE, which
-            ;; are convenience macros.  See INOTIFY(7).
-            (mapcar
-             (lambda (x)
-               (intern-soft (replace-regexp-in-string "_" "-" (downcase x))))
-             (delete "MOVE" (delete "CLOSE"
-               (split-string (match-string 1 line) "," 'omit-nulls))))
-            ;; We cannot gather any cookie value.  So we return 0 as
-            ;; "don't know".
-            0 (match-string 3 line)))
-          (callback
-           (tramp-get-connection-property proc "inotify-callback" nil))
-          (event `(file-inotify ,object ,callback)))
-
-      ;; Usually, we would add an Emacs event now.  Unfortunately,
-      ;; `unread-command-events' does not accept several events at
-      ;; once.  Therefore, we apply the callback directly.
-      ;(setq unread-command-events (cons event unread-command-events)))))
-      (let ((last-input-event event))
-       (funcall callback object)))))
-
 ;;; Internal Functions:
 
 (defun tramp-maybe-send-script (vec script name)
@@ -4331,7 +4248,7 @@ Gateway hops are already opened."
            (setq choices tramp-default-proxies-alist)))))
 
     ;; Handle gateways.
-    (when (and tramp-gw-tunnel-method tramp-gw-socks-method
+    (when (and (boundp 'tramp-gw-tunnel-method) (boundp 'tramp-gw-socks-method)
               (string-match
                (format
                 "^\\(%s\\|%s\\)$" tramp-gw-tunnel-method tramp-gw-socks-method)
@@ -4416,7 +4333,7 @@ connection if a previous connection has died for some reason."
                              (car tramp-current-connection)))
                  (> (tramp-time-diff
                      (current-time) (cdr tramp-current-connection))
-                    5))
+                    (or tramp-connection-min-time-diff 0)))
        (throw 'suppress 'suppress))
 
       ;; If too much time has passed since last command was sent, look
@@ -4473,6 +4390,9 @@ connection if a previous connection has died for some reason."
              (setenv "PROMPT_COMMAND")
              (setenv "PS1" tramp-initial-end-of-output)
              (let* ((target-alist (tramp-compute-multi-hops vec))
+                    ;; We will apply `tramp-ssh-controlmaster-options'
+                    ;; only for the first hop.
+                    (options tramp-ssh-controlmaster-options)
                     (process-connection-type tramp-process-connection-type)
                     (process-adaptive-read-buffering nil)
                     (coding-system-for-read nil)
@@ -4534,14 +4454,16 @@ connection if a previous connection has died for some reason."
                         ;; temporary file has another name, and it is
                         ;; created and protected by ssh.  It is also
                         ;; removed by ssh when the connection is
-                        ;; closed.
+                        ;; closed.  The temporary file name is cached
+                        ;; in the main connection process, therefore
+                        ;; we cannot use `tramp-get-connection-process'.
                         (tmpfile
-                         (tramp-set-connection-property
-                          p "temp-file"
-                          (make-temp-name
-                           (expand-file-name
-                            tramp-temp-name-prefix
-                            (tramp-compat-temporary-file-directory)))))
+                         (with-tramp-connection-property
+                             (get-process (tramp-buffer-name vec)) "temp-file"
+                           (make-temp-name
+                            (expand-file-name
+                             tramp-temp-name-prefix
+                             (tramp-compat-temporary-file-directory)))))
                         spec r-shell)
 
                    ;; Add arguments for asynchronous processes.
@@ -4575,8 +4497,10 @@ connection if a previous connection has died for some reason."
                     l-host (or l-host "")
                     l-user (or l-user "")
                     l-port (or l-port "")
+                    spec (format-spec-make ?t tmpfile)
+                    options (format-spec options spec)
                     spec (format-spec-make
-                          ?h l-host ?u l-user ?p l-port ?t tmpfile)
+                          ?h l-host ?u l-user ?p l-port ?c options)
                     command
                     (concat
                      ;; We do not want to see the trailing local
@@ -4603,7 +4527,8 @@ connection if a previous connection has died for some reason."
                    (tramp-message
                     vec 3 "Found remote shell prompt on `%s'" l-host))
                  ;; Next hop.
-                 (setq target-alist (cdr target-alist)))
+                 (setq options ""
+                       target-alist (cdr target-alist)))
 
                ;; Make initial shell settings.
                (tramp-open-connection-setup-interactive-shell p vec))))
@@ -5105,11 +5030,6 @@ This is used internally by `tramp-file-mode-from-int'."
     (tramp-message vec 5 "Finding a suitable `trash' command")
     (tramp-find-executable vec "trash" (tramp-get-remote-path vec))))
 
-(defun tramp-get-remote-inotifywait (vec)
-  (with-tramp-connection-property vec "inotifywait"
-    (tramp-message vec 5 "Finding a suitable `inotifywait' command")
-    (tramp-find-executable vec "inotifywait" (tramp-get-remote-path vec) t t)))
-
 (defun tramp-get-remote-id (vec)
   (with-tramp-connection-property vec "id"
     (tramp-message vec 5 "Finding POSIX `id' command")