Skip to content

Foam opens a new note for root-path relative links instead of opening the file #1505

@DevPartner

Description

@DevPartner

Reproduction

  1. Create a Markdown file that contains a root-path relative link, for example:
[text](/shallow-work/weekly/2025-08-10-gpt-review.md)
  1. In VS Code with Foam enabled, Ctrl+Click the link in the preview or editor.

Actual

Foam creates a new note instead of opening the existing file at /shallow-work/weekly/2025-08-10-gpt-review.md.

Expected

VS Code built-in link behavior: open the target file in the editor. Foam should follow the same behavior for root-path relative links and links to files under .foam (for example templates), and not create a new note.

Notes

  • The issue does not occur for relative links based on the current file path (e.g. ../weekly/...) or for wikilinks ([[...]]).
  • Example that also behaves unexpectedly:
[Weekly](../.foam/templates/weekly-review.md)

Environment

  • VS Code
  • Foam
  • OS: Windows

Workarounds

  • Use relative links from the current file path instead of root-path links, or use wikilinks.

Request

Please Keep Default VSCode bechavior Ctrl+Click for root-path links

Success criteria (examples)

  • Ctrl+Click on /shallow-work/weekly/2025-08-10-gpt-review.md opens that file in the editor (PASS).
  • Ctrl+Click on a .foam template reference opens the template file instead of creating a new note (PASS).
  • No new notes are created for existing files when following root-path links (PASS).

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