Skip to content

Skip paths starting with /\ in file link detection #853

Done

Description

@vjohansen

(unless (string-prefix-p "//" path)

I see a variant of the issue from #759 when output has regular expressions like /\r/g

On Windows: (expand-file-name "/\\r/g") -> "//r/g" (/\r/g becomes //r/g)

So i run into the 10 seconds hang again from file-exists-p where Windows reads that as a UNC path then waits for the network lookup of host to time out.

Fix

-            (unless (string-prefix-p "//" path)
+            ;; So does `/\', as in a regex like `/\r/g': `expand-file-name'
+            ;; turns the backslash into a slash.
+            (unless (string-match-p "\\`/[/\\]" path)
               (if (ghostel--skip-match-p fragments raw active-bounds)

This then skips expand-file-name call and file-exists-p call in unless block

Activity

  1. dakra commented on Dec 1, 2026

    @dakra
    Owner

    Thanks. Should be fixed on main.

  2. added a commit that references this issue on Dec 1, 2026
    71f17de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions