]> git.eshelyaron.com Git - emacs.git/commitdiff
; Sync missing TRAMP update from 'master'
authorEshel Yaron <me@eshelyaron.com>
Sun, 4 Feb 2024 11:07:51 +0000 (12:07 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 4 Feb 2024 11:07:51 +0000 (12:07 +0100)
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
(tramp-maybe-open-connection): Sync with 'master'.

lisp/net/tramp-sh.el

index a29507b539977a35cbd649ce456532be733f1ece..33ab1c42db15b0235dc6502f970059026f6e1638 100644 (file)
@@ -2531,8 +2531,6 @@ The method used must be an out-of-band method."
                      (tramp-get-connection-name v)
                      (tramp-get-connection-buffer v)
                      copy-program copy-args)))
-               (tramp-message v 6 "%s" (string-join (process-command p) " "))
-               (process-put p 'tramp-vector v)
                ;; This is needed for ssh or PuTTY based processes, and
                ;; only if the respective options are set.  Perhaps,
                ;; the setting could be more fine-grained.
@@ -3875,8 +3873,6 @@ Fall back to normal file name handler if no Tramp handler exists."
           v 'file-notify-error
           "`%s' failed to start on remote host"
           (string-join sequence " "))
-       (tramp-message v 6 "Run `%s', %S" (string-join sequence " ") p)
-       (process-put p 'tramp-vector v)
        ;; This is needed for ssh or PuTTY based processes, and only if
        ;; the respective options are set.  Perhaps, the setting could
        ;; be more fine-grained.
@@ -5267,16 +5263,14 @@ connection if a previous connection has died for some reason."
                              (and tramp-encoding-command-interactive
                                   `(,tramp-encoding-command-interactive)))))))
 
-               ;; Set sentinel and query flag.  Initialize variables.
-               (set-process-sentinel p #'tramp-process-sentinel)
-               (process-put p 'tramp-vector vec)
-               ;; This is needed for ssh or PuTTY based processes, and
-               ;; only if the respective options are set.  Perhaps,
-               ;; the setting could be more fine-grained.
-               ;; (process-put p 'tramp-shared-socket t)
-               (process-put p 'adjust-window-size-function #'ignore)
-               (set-process-query-on-exit-flag p nil)
-               (setq tramp-current-connection (cons vec (current-time)))
+                 ;; This is needed for ssh or PuTTY based processes,
+                 ;; and only if the respective options are set.
+                 ;; Perhaps, the setting could be more fine-grained.
+                 ;; (process-put p 'tramp-shared-socket t)
+                 ;; Set sentinel.  Initialize variables.
+                 (set-process-sentinel p #'tramp-process-sentinel)
+                 (tramp-post-process-creation p vec)
+                 (setq tramp-current-connection (cons vec (current-time)))
 
                  ;; Set connection-local variables.
                  (tramp-set-connection-local-variables vec)
@@ -5341,28 +5335,13 @@ connection if a previous connection has died for some reason."
                          :method l-method :user l-user :domain l-domain
                          :host l-host :port l-port)))
 
-                   ;; Replace `login-args' place holders.
-                   (setq
-                    command
-                    (mapconcat
-                     #'identity
-                     (append
-                      ;; We do not want to see the trailing local
-                      ;; prompt in `start-file-process'.
-                      (unless r-shell '("exec"))
-                      `(,command)
-                      ;; Add arguments for asynchronous processes.
-                      (when process-name async-args)
-                      (tramp-expand-args
-                       hop 'tramp-login-args
-                       ?h (or l-host "") ?u (or l-user "") ?p (or l-port "")
-                       ?c (format-spec options (format-spec-make ?t tmpfile))
-                       ?n (concat
-                           "2>" (tramp-get-remote-null-device previous-hop))
-                       ?l (concat remote-shell " " extra-args " -i"))
-                      ;; A restricted shell does not allow "exec".
-                      (when r-shell '("&&" "exit")) '("||" "exit"))
-                     " "))
+                     ;; Set session timeout.
+                     (when (tramp-get-method-parameter
+                            hop 'tramp-session-timeout)
+                       (tramp-set-connection-property
+                        p "session-timeout"
+                        (tramp-get-method-parameter
+                         hop 'tramp-session-timeout)))
 
                      ;; Replace `login-args' place holders.
                      (setq
@@ -5383,7 +5362,7 @@ connection if a previous connection has died for some reason."
                              "2>" (tramp-get-remote-null-device previous-hop))
                          ?l (concat remote-shell " " extra-args " -i"))
                         ;; A restricted shell does not allow "exec".
-                        (when r-shell '("&&" "exit" "||" "exit")))
+                        (when r-shell '("&&" "exit")) '("||" "exit"))
                        " "))
 
                      ;; Send the command.