]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/ansi-osc.el (ansi-osc-directory-tracker): Don't check host name.
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 10 Feb 2025 15:37:25 +0000 (16:37 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Feb 2025 10:41:37 +0000 (11:41 +0100)
(cherry picked from commit 0c7214dc97aef577487d71851580e8a68784075d)

lisp/ansi-osc.el

index 5334089ee48f150fe98213d23547e40b9b092c13..ef08ccd44eeaa745b68dc5564394d4ee29dc5b69 100644 (file)
@@ -114,16 +114,15 @@ list that is the value of `ansi-osc-handlers'.  You should arrange
 for your shell to print the appropriate escape sequence at each prompt,
 such as with the following command:
 
-    printf \"\\e]7;file://%s%s\\e\\\\\" \"$HOSTNAME\" \"$PWD\""
-  (let ((url (url-generic-parse-url text)))
-    (when (and (string= (url-type url) "file")
-               (or (null (url-host url))
-                   ;; Use `downcase' to match `url-generic-parse-url' behavior
-                   (string= (url-host url) (downcase (system-name)))))
-      (ignore-errors
-        (cd-absolute
-         (concat (file-remote-p default-directory
-                                (url-unhex-string (url-filename url)))))))))
+    printf \"\\e]7;file://%s%s\\e\\\\\" \"$HOSTNAME\" \"$PWD\"
+
+A remote `default-directory' is maintained."
+  (when-let* ((url (url-generic-parse-url text))
+              ((string= (url-type url) "file")))
+    (ignore-errors
+      (cd-absolute
+       (concat (file-remote-p default-directory)
+               (url-unhex-string (url-filename url)))))))
 
 ;; Hyperlink handling (OSC 8)