GNU bug report logs - #76165
[PATCH] ansi-osc-directory-tracker respects Tramp remote files

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Sun, 9 Feb 2025 19:06:01 UTC

Severity: normal

Tags: patch

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #58 received at 76165 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 76165 <at> debbugs.gnu.org, Ship Mints <shipmints <at> gmail.com>
Subject: Re: bug#76165: [PATCH] ansi-osc-directory-tracker respects Tramp
 remote files
Date: Mon, 10 Feb 2025 14:55:22 +0100
Visuwesh <visuweshm <at> gmail.com> writes:

Hi,

>>>     (concat (file-remote-p default-directory)
>>>             (url-unhex-string (url-filename url)))
>>
>> Looks like, yes :-(
>>
>> Since I don't know how to activate ansi-osc-directory-tracker in a shell
>> (where is it documented?), I couldn't test it. Could you pls advice me?
>
> The documentation is spread over two places:
>
>     1. Docstring of `ansi-osc-directory-tracker' tells how to set up
>        things from the shell side.
>     2. You need to add `comint-osc-process-output' to
>        `comint-output-filter-functions' (as the commentary following
>        comint.el:3998 instructs you to).

I've fixed ansi-osc-directory-tracker as described above, and started a
test as given in the recipe. Testing on a remote host, different from my
local one.

There is the following code in ansi-osc-directory-tracker:

--8<---------------cut here---------------start------------->8---
    (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)))))
      ...
--8<---------------cut here---------------end--------------->8---

But on the remote host, neither (null (url-host url)) nor (string=
(url-host url) (downcase (system-name))) return t; simply because the
host name is not nil or equal to (system-name).

Instead, the following shall be sufficient:

--8<---------------cut here---------------start------------->8---
    (when (string= (url-type url) "file")
      ...
--8<---------------cut here---------------end--------------->8---

Comments?

Best regards, Michael.




This bug report was last modified 151 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.