Skip to content

feat: respect .gitignore in tree sidebar #5135

Closed

Description

@rkristelijn

Problem

When opening a folder that contains a .gitignore, the tree sidebar still shows ignored paths like .git/, .amazonq/, node_modules/ (partially handled), build artifacts, etc.

Currently the only filtering is:

  • Hardcoded node_modules and .asar exclusion
  • Manual treePathExcludePatterns preference (empty by default)

Users have to manually configure exclude patterns for every project, which defeats the purpose — the project already declares what should be ignored in .gitignore.

Proposed Solution

When a folder is opened and a .gitignore file exists at the root:

  1. Parse the .gitignore patterns
  2. Apply them to the chokidar watcher's ignored callback alongside existing filters
  3. Optionally: add a preference toggle to disable this behavior (default: enabled)

This should be additive to the existing treePathExcludePatterns — both filters apply.

Environment

  • Linux Mint 22.3
  • MarkText develop branch

Activity

  1. Jocs commented on Sep 7, 2026

    @Jocs
    Member

    I don’t quite understand why gitignore should be reused in MarkText.

  2. added
    🦁 need discuss
    on Sep 8, 2026
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

    🦁 need discuss

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions